1/*
2 * Copyright 2010-2017 Haiku Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 *
5 * Authors:
6 *		Christophe Huriaux, c.huriaux@gmail.com
7 *		Adrien Destugues, pulkomandy@pulkomandy.tk
8 */
9
10#include <cstdio>
11
12#include <UrlRequest.h>
13#include <UrlProtocolListener.h>
14
15using namespace std;
16using namespace BPrivate::Network;
17
18
19void
20BUrlProtocolListener::ConnectionOpened(BUrlRequest*)
21{
22}
23
24
25void
26BUrlProtocolListener::HostnameResolved(BUrlRequest*, const char*)
27{
28}
29
30
31bool
32BUrlProtocolListener::CertificateVerificationFailed(BUrlRequest* caller,
33	BCertificate& certificate, const char* message)
34{
35	return false;
36}
37
38
39void
40BUrlProtocolListener::ResponseStarted(BUrlRequest*)
41{
42}
43
44
45
46void
47BUrlProtocolListener::HeadersReceived(BUrlRequest*)
48{
49}
50
51
52void
53BUrlProtocolListener::BytesWritten(BUrlRequest*, size_t)
54{
55}
56
57
58void
59BUrlProtocolListener::DownloadProgress(BUrlRequest*, off_t, off_t)
60{
61}
62
63
64void
65BUrlProtocolListener::UploadProgress(BUrlRequest*, off_t, off_t)
66{
67}
68
69
70void
71BUrlProtocolListener::RequestCompleted(BUrlRequest*, bool)
72{
73}
74
75
76void
77BUrlProtocolListener::DebugMessage(BUrlRequest* caller,
78	BUrlProtocolDebugMessage type, const char* text)
79{
80#ifdef DEBUG
81	switch (type) {
82		case B_URL_PROTOCOL_DEBUG_TEXT:
83			fprintf(stderr, "   ");
84			break;
85
86		case B_URL_PROTOCOL_DEBUG_ERROR:
87			fprintf(stderr, "!!!");
88			break;
89
90		case B_URL_PROTOCOL_DEBUG_TRANSFER_IN:
91		case B_URL_PROTOCOL_DEBUG_HEADER_IN:
92			fprintf(stderr, "<--");
93			break;
94
95		case B_URL_PROTOCOL_DEBUG_TRANSFER_OUT:
96		case B_URL_PROTOCOL_DEBUG_HEADER_OUT:
97			fprintf(stderr, "-->");
98			break;
99	}
100
101	fprintf(stderr, " %s: %s\n", caller->Protocol().String(), text);
102#endif
103}
104