10 Commits

Author SHA1 Message Date
MassimilianoPinto
badb2e3f2c Added return code to setipaddress and removed fprintfs
Added return code to setipaddress and removed fprintfs
2014-02-14 12:27:33 +01:00
Mark Riddoch
1742372dd5 Added support for defining a bind address in the listener config.
Also removed some compilation warnings.

See Bugzilla bug 150
2014-02-06 19:04:12 +01:00
Massimiliano Pinto
05d365e4b4 fprintf(9 removed 2013-12-17 11:07:29 +01:00
vraatikka
97bc1ed042 Fixed comments to be compatible with doxygen 2013-12-13 19:11:10 +02:00
vraatikka
655a6537b2 mysql_client_server_protocol.h :
changed gw_receive_backend_auth declaration to return int instead of boolean.
mysql_backend.c:
	gw_read_backend_event calls gw_receive_backend_auth which either fails (== -1), succeeds with nothing to read (== 0) or succeeds (== 1). For each case there is handling. If dcb_read succeeds without read bytes, return asap.
mysql_client.c:
	gw_error_client_event, gw_client_close, gw_client_hangup_event : all close client dcb but now they also close backend dcb.
mysql_common.c:
	gw_receive_backend_auth, return -1, 0, or 1 if read from backend failed, was empty, or succeed, respectively.:
2013-10-07 14:00:44 +03:00
vraatikka
80b67d1083 log_manager.cc:
State update for filewriter was missing and that caused Maxscale to fail if opening of any log file failed.
dcb.c:
	Added EAGAIN and EWOULDBLOCK handling to dcb_read. If dcb_close is called for freshly created dcb, dcb is only freed.
gateway.c:
	Added file_write_footer and write_footer of which the latter is called at exit time. It simply draws a line to screen.
gw_utils.c:
	Some macros for helping comparison between gw_read_gwbuff and dcb_read, which overlap.
poll.c:
	Some macros to help enable/disable mutexing in poll_waitevents
service.c:
	Check return value of listen and session_alloc and behave accordingly.

mysql_client.c:
	If ioctl returned successfully with b==0 it earlier caused closing the client and backend dcbs. Since that doesn't reliably indicate that client has closed socket on its side, Maxscale doesn't close its sockets either.
mysql_common.c:
	In gw_receive_backend_auth, if dcb_read returns n==0, it is not considered as an error anymore. The implemented behavior is not yet complete and correct. Result should be successful but the protocol state shouldn't change to MYSQL_IDLE before backend return is received.
	In gw_send_authentication_to_backend protocol state was always set to MYSQL_AUTH_RECV even if gw_rwite had failed. Now, return value is read and state is set in caller's context basen on the return value.
skygw_utils.cc:
	Removed ss_dassert from skyge_file_init because it prevented from returning meaningful error meassage to the client.:
2013-10-06 22:31:32 +03:00
Massimiliano Pinto
44d424adb4 setipaddress uses getaddrinfo
for listening socket different flags are used, detection is based on 0.0.0.0

This will change when supporting multiple binding addresses.
2013-09-25 11:08:39 +02:00
vraatikka
4f8057034a Protected temporarily with spinlock gethostbyname which is not thread safe. This should be changed permanently so that gethostbyname is replaced with getaddrinfo. 2013-09-05 19:42:59 +03:00
Mark Riddoch
9fe7a83675 Fixes for resource leaks foudn with Coverity.
Bug 173, 174, 175, 176 and 177
2013-08-21 17:26:55 +02:00
Timofey Turenko
a7c82310f9 moving files to /server to make merge possible 2013-07-28 05:31:11 +00:00