[xio-commit] CVS update: MODIFIED: http, globus_xio_http_client.c
Joe Bester
commit at globus.org
Wed Apr 30 13:25:28 CDT 2008
, globus_xio_http_transform.c
...
User: bester
Date: 08/04/30 13:25:28
Modified: src/builtins/http globus_i_xio_http.h globus_xio_http.h
globus_xio_http_client.c
globus_xio_http_transform.c
Log:
Detect dropped persistent connections and report them via the result returned
from xio operations
Revision Changes Path
1.14 +21 -0 xio/src/builtins/http/globus_i_xio_http.h
http://viewcvs.globus.org/viewcvs.cgi/xio/src/builtins/http/globus_i_xio_http.h.diff?r1=1.13&r2=1.14
(In the diff below, changes in quantity of whitespace are not shown.)
Index: globus_i_xio_http.h
===================================================================
RCS file: /home/globdev/CVS/globus-packages/xio/src/builtins/http/globus_i_xio_http.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- globus_i_xio_http.h 29 Apr 2008 19:50:27 -0000 1.13
+++ globus_i_xio_http.h 30 Apr 2008 18:25:27 -0000 1.14
@@ -391,6 +391,12 @@
* Cancellation info
*/
globus_i_xio_http_cancellation_t * cancellation;
+ /**
+ * Set to true if a connection is reused, so that we can
+ * return a "persistent connection" error if the server
+ * drops us
+ */
+ globus_bool_t reopen_in_progress;
}
globus_i_xio_http_handle_t;
@@ -790,6 +796,21 @@
#define GlobusXIOHttpErrorEOF() \
globus_error_put( \
GlobusXIOHttpErrorObjEOF())
+
+#define GlobusXIOHttpErrorPersistentConnectionDropped(cause) \
+ globus_error_put( \
+ GlobusXIOHTTPErrorObjPersistentConnectionDropped(cause))
+
+#define GlobusXIOHTTPErrorObjPersistentConnectionDropped(cause) \
+ globus_error_construct_error( \
+ GLOBUS_XIO_HTTP_MODULE, \
+ cause, \
+ GLOBUS_XIO_HTTP_ERROR_PERSISTENT_CONNECTION_DROPPED, \
+ __FILE__, \
+ _xio_name, \
+ __LINE__, \
+ "Persistent connection dropped")
+
#endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */
#endif /* GLOBUS_I_XIO_HTTP_H */
1.12 +5 -1 xio/src/builtins/http/globus_xio_http.h
http://viewcvs.globus.org/viewcvs.cgi/xio/src/builtins/http/globus_xio_http.h.diff?r1=1.11&r2=1.12
(In the diff below, changes in quantity of whitespace are not shown.)
Index: globus_xio_http.h
===================================================================
RCS file: /home/globdev/CVS/globus-packages/xio/src/builtins/http/globus_xio_http.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- globus_xio_http.h 19 Jan 2006 05:57:40 -0000 1.11
+++ globus_xio_http.h 30 Apr 2008 18:25:27 -0000 1.12
@@ -433,7 +433,11 @@
/**
* Server side fake EOF
*/
- GLOBUS_XIO_HTTP_ERROR_EOF
+ GLOBUS_XIO_HTTP_ERROR_EOF,
+ /**
+ * Persistent connection dropped by the server.
+ */
+ GLOBUS_XIO_HTTP_ERROR_PERSISTENT_CONNECTION_DROPPED
}
globus_xio_http_errors_t;
1.18 +13 -0 xio/src/builtins/http/globus_xio_http_client.c
http://viewcvs.globus.org/viewcvs.cgi/xio/src/builtins/http/globus_xio_http_client.c.diff?r1=1.17&r2=1.18
(In the diff below, changes in quantity of whitespace are not shown.)
Index: globus_xio_http_client.c
===================================================================
RCS file: /home/globdev/CVS/globus-packages/xio/src/builtins/http/globus_xio_http_client.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- globus_xio_http_client.c 29 Apr 2008 19:50:27 -0000 1.17
+++ globus_xio_http_client.c 30 Apr 2008 18:25:27 -0000 1.18
@@ -625,6 +625,15 @@
globus_libc_free(http_handle->read_buffer.iov_base);
http_handle->read_buffer.iov_len = 0;
error_exit:
+ if (http_handle->reopen_in_progress)
+ {
+ globus_object_t * cause = NULL;
+ if (result != GLOBUS_SUCCESS)
+ {
+ cause = globus_error_get(result);
+ }
+ result = GlobusXIOHttpErrorPersistentConnectionDropped(cause);
+ }
if(http_handle->delay_write_header)
{
@@ -712,6 +721,10 @@
http_handle->write_operation.operation);
globus_assert(result == GLOBUS_SUCCESS);
}
+ if (http_handle->reopen_in_progress)
+ {
+ response_error = GlobusXIOHTTPErrorObjPersistentConnectionDropped(response_error);
+ }
/* don't go to error exit yet because we may need to clean up
* the cancel info
*/
1.20 +10 -0 xio/src/builtins/http/globus_xio_http_transform.c
http://viewcvs.globus.org/viewcvs.cgi/xio/src/builtins/http/globus_xio_http_transform.c.diff?r1=1.19&r2=1.20
(In the diff below, changes in quantity of whitespace are not shown.)
Index: globus_xio_http_transform.c
===================================================================
RCS file: /home/globdev/CVS/globus-packages/xio/src/builtins/http/globus_xio_http_transform.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- globus_xio_http_transform.c 29 Apr 2008 19:50:27 -0000 1.19
+++ globus_xio_http_transform.c 30 Apr 2008 18:25:27 -0000 1.20
@@ -200,6 +200,7 @@
http_handle->send_state = GLOBUS_XIO_HTTP_REQUEST_LINE;
http_handle->parse_state = GLOBUS_XIO_HTTP_STATUS_LINE;
+ http_handle->reopen_in_progress = GLOBUS_TRUE;
result = globus_i_xio_http_client_write_request(op, http_handle);
error_exit:
@@ -1566,6 +1567,7 @@
{
globus_i_xio_http_handle_t * http_handle = user_arg;
globus_i_xio_http_header_info_t * headers;
+ GlobusXIOName(globus_i_xio_http_write_callback);
if (http_handle->target_info.is_client)
{
@@ -1616,6 +1618,14 @@
http_handle->write_operation.driver_handle = NULL;
http_handle->write_operation.nbytes = 0;
http_handle->write_operation.wait_for = 0;
+ if (result != GLOBUS_SUCCESS && http_handle->reopen_in_progress)
+ {
+ globus_object_t * err;
+
+ err = globus_error_get(result);
+
+ result = GlobusXIOHttpErrorPersistentConnectionDropped(err);
+ }
globus_mutex_unlock(&http_handle->mutex);
More information about the xio-commit
mailing list