libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit ee69fbf07d1e2fa824d5333c85b826bd7b20b08a
parent ce027a58ee2f50b2b20eba590d885530f12c7032
Author: Andrey Uzunov <andrey.uzunov@gmail.com>
Date:   Wed, 14 Aug 2013 22:18:34 +0000

spdy:warnings fixed in event loop example

Diffstat:
Msrc/examples/spdy_event_loop.c | 35+++++++++++++++++++++++++++--------
1 file changed, 27 insertions(+), 8 deletions(-)

diff --git a/src/examples/spdy_event_loop.c b/src/examples/spdy_event_loop.c @@ -22,7 +22,7 @@ * PROGRAM * @author Andrey Uzunov */ - + #include "platform.h" #include <unistd.h> #include <stdlib.h> @@ -55,6 +55,8 @@ static void new_session_callback (void *cls, struct SPDY_Session * session) { + (void)cls; + char ipstr[1024]; struct sockaddr *addr; @@ -96,6 +98,9 @@ session_closed_handler (void *cls, struct SPDY_Session * session, int by_client) { + (void)cls; + (void)session; + //printf("session_closed_handler called\n"); if(SPDY_YES != by_client) @@ -139,7 +144,7 @@ response_done_callback(void *cls, free(cls); } - +/* static int print_headers (void *cls, const char *name, const char *value) @@ -148,6 +153,8 @@ print_headers (void *cls, printf("%s: %s\n",name,value); return SPDY_YES; } + */ + /* void @@ -202,6 +209,8 @@ standard_request_handler(void *cls, struct SPDY_NameValue * headers, bool more) { + (void)more; + char *html; char *data; struct SPDY_Response *response=NULL; @@ -267,6 +276,10 @@ new_post_data_cb (void * cls, size_t size, bool more) { + (void)cls; + (void)request; + (void)more; + printf("DATA:\n===============================\n"); write(0, buf, size); printf("\n===============================\n"); @@ -277,7 +290,9 @@ new_post_data_cb (void * cls, static void sig_handler(int signo) { - printf("received signal\n"); + (void)signo; + + printf("received signal\n"); } @@ -293,13 +308,15 @@ main (int argc, char *const *argv) SPDY_init(); - struct sockaddr_in addr4; + /* + struct sockaddr_in addr4; struct in_addr inaddr4; inaddr4.s_addr = htonl(INADDR_ANY); addr4.sin_family = AF_INET; addr4.sin_addr = inaddr4; addr4.sin_port = htons(atoi(argv[1])); - + */ + struct SPDY_Daemon *daemon = SPDY_start_daemon(atoi(argv[1]), DATA_DIR "cert-and-key.pem", DATA_DIR "cert-and-key.pem", @@ -313,11 +330,13 @@ main (int argc, char *const *argv) return 1; } + /* struct sockaddr_in6 addr6; addr6.sin6_family = AF_INET6; addr6.sin6_addr = in6addr_any; addr6.sin6_port = htons(atoi(argv[1]) + 1); - + */ + struct SPDY_Daemon *daemon2 = SPDY_start_daemon(atoi(argv[1]) + 1, DATA_DIR "cert-and-key.pem", DATA_DIR "cert-and-key.pem", @@ -363,7 +382,7 @@ main (int argc, char *const *argv) timeout.tv_usec = (timeoutlong % 1000) * 1000; } - printf("ret=%i; timeoutlong=%i; sec=%i; usec=%i\n", ret, timeoutlong, timeout.tv_sec, timeout.tv_usec); + printf("ret=%i; timeoutlong=%llu; sec=%llu; usec=%llu\n", ret, timeoutlong, (long long unsigned)timeout.tv_sec, (long long unsigned)timeout.tv_usec); //raise(SIGINT); /* get file descriptors from the transfers */ @@ -395,7 +414,7 @@ main (int argc, char *const *argv) } else if(daemon != NULL){ - printf("%i loops in %i secs\n", loops, time(NULL) - start); + printf("%lu loops in %llu secs\n", loops, (long long unsigned)(time(NULL) - start)); SPDY_stop_daemon(daemon); daemon=NULL; }