1
0
mirror of https://github.com/payden/libwsclient synced 2024-10-27 17:54:01 +00:00

Prevents multiple definition linker errors

This commit is contained in:
SpaceboyRoss01 2019-02-03 15:18:40 -08:00
parent d416fcb62c
commit 9afb1a5ef6
2 changed files with 27 additions and 26 deletions

View File

@ -19,6 +19,30 @@
#include "config.h" #include "config.h"
#include "sha1.h" #include "sha1.h"
int libwsclient_flags = 0;
const char *errors[] = {
"Unknown error occured",
"Error while getting address info",
"Could connect to any address returned by getaddrinfo",
"Error receiving data in client run thread",
"Error during libwsclient_close",
"Error sending while handling control frame",
"Received masked frame from server",
"Got null pointer during message dispatch",
"Attempted to send after close frame was sent",
"Attempted to send during connect",
"Attempted to send null payload",
"Attempted to send too much data",
"Error during send in libwsclient_send",
"Remote end closed connection during handshake",
"Problem receiving data during handshake",
"Remote web server responded with bad HTTP status during handshake",
"Remote web server did not respond with upgrade header during handshake",
"Remote web server did not respond with connection header during handshake",
"Remote web server did not specify the appropriate Sec-WebSocket-Accept header during handshake",
NULL
};
void libwsclient_run(wsclient *c) { void libwsclient_run(wsclient *c) {
if(c->flags & CLIENT_CONNECTING) { if(c->flags & CLIENT_CONNECTING) {

View File

@ -137,31 +137,8 @@ void libwsclient_close(wsclient *c);
int libwsclient_helper_socket(wsclient *c, const char *path); int libwsclient_helper_socket(wsclient *c, const char *path);
void *libwsclient_helper_socket_thread(void *ptr); void *libwsclient_helper_socket_thread(void *ptr);
//Define errors #if !defined(libwsclient_flags)
char *errors[] = { extern int libwsclient_flags; //global flags variable
"Unknown error occured", #endif
"Error while getting address info",
"Could connect to any address returned by getaddrinfo",
"Error receiving data in client run thread",
"Error during libwsclient_close",
"Error sending while handling control frame",
"Received masked frame from server",
"Got null pointer during message dispatch",
"Attempted to send after close frame was sent",
"Attempted to send during connect",
"Attempted to send null payload",
"Attempted to send too much data",
"Error during send in libwsclient_send",
"Remote end closed connection during handshake",
"Problem receiving data during handshake",
"Remote web server responded with bad HTTP status during handshake",
"Remote web server did not respond with upgrade header during handshake",
"Remote web server did not respond with connection header during handshake",
"Remote web server did not specify the appropriate Sec-WebSocket-Accept header during handshake",
NULL
};
int libwsclient_flags; //global flags variable
#endif /* WSCLIENT_H_ */ #endif /* WSCLIENT_H_ */