Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:jberkman
evolution-exchange-2.6
bnc-166987-exchange.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bnc-166987-exchange.patch of Package evolution-exchange-2.6
Index: camel/camel-stub-marshal.c =================================================================== RCS file: /cvs/gnome/evolution-exchange/camel/camel-stub-marshal.c,v retrieving revision 1.2 diff -u -r1.2 camel/camel-stub-marshal.c --- camel/camel-stub-marshal.c 14 Sep 2004 19:28:45 -0000 1.2 +++ camel/camel-stub-marshal.c 4 May 2006 19:43:44 -0000 @@ -27,6 +27,8 @@ #include <stdlib.h> #include <unistd.h> +#include <camel/camel-file-utils.h> + #include "camel-stub-marshal.h" #if 1 @@ -82,27 +84,14 @@ } static gboolean -do_read (CamelStubMarshal *marshal, char *buf, int len) +do_read (CamelStubMarshal *marshal, char *buf, size_t len) { - int nread; - - while (len) { - nread = read (marshal->fd, buf, len); - if (nread < 1) { - if (nread == -1 && errno == EINTR) { - if (DEBUGGING) - printf ("<<< Interrupted read\n"); - continue; - } - if (DEBUGGING) - printf ("<<< read: %d (%s)\n", nread, g_strerror (errno)); - close (marshal->fd); - marshal->fd = -1; - return FALSE; - } - len -= nread; - buf += nread; + if (camel_read (marshal->fd, buf, len) == -1) { + close (marshal->fd); + marshal->fd = -1; + return FALSE; } + return TRUE; } @@ -425,8 +414,8 @@ int camel_stub_marshal_flush (CamelStubMarshal *marshal) { - int nwrote, off, left; - + int left; + if (marshal->out->len == 4) return 0; @@ -438,35 +427,22 @@ if (DEBUGGING) printf ("---\n"); - - off = 0; + left = marshal->out->len; - + marshal->out->data[0] = left & 0xFF; marshal->out->data[1] = (left >> 8) & 0xFF; marshal->out->data[2] = (left >> 16) & 0xFF; marshal->out->data[3] = (left >> 24) & 0xFF; - - while (left) { - nwrote = write (marshal->fd, marshal->out->data + off, left); - if (nwrote == -1 && errno == EINTR) { - if (DEBUGGING) - printf (">>> Interrupted write\n"); - continue; - } - if (nwrote < 1) { - if (DEBUGGING) - printf (">>> write: %d (%s)\n", nwrote, g_strerror (errno)); - if (nwrote == -1 && errno == EPIPE) { - close (marshal->fd); - marshal->fd = -1; - } - return -1; - } - off += nwrote; - left -= nwrote; + + if (camel_write (marshal->fd, marshal->out->data, marshal->out->len) == -1) { + close (marshal->fd); + marshal->fd = -1; + return -1; } + g_byte_array_set_size (marshal->out, 4); + return 0; } Index: camel/camel-stub.c =================================================================== RCS file: /cvs/gnome/evolution-exchange/camel/camel-stub.c,v retrieving revision 1.4 diff -u -r1.4 camel/camel-stub.c --- camel/camel-stub.c 12 Jan 2005 08:51:39 -0000 1.4 +++ camel/camel-stub.c 4 May 2006 19:43:44 -0000 @@ -62,9 +62,19 @@ /* When we close the command channel, the storage will * close the status channel, which will in turn cause * the status loop to exit. + * + * Hah... as if. More than likely it'll just get caught in a read() call. */ + if (stub->op) + camel_operation_cancel (stub->op); + pthread_join (stub->status_thread, &unused); camel_stub_marshal_free (stub->status); + + if (stub->op) { + camel_operation_unref (stub->op); + stub->op = NULL; + } } if (stub->backend_name) @@ -104,11 +114,17 @@ CamelStub *stub = data; CamelStubMarshal *status_channel = stub->status; guint32 retval; - + + stub->op = camel_operation_new (NULL, NULL); + camel_operation_register (stub->op); + while (1) { + if (camel_operation_cancel_check (stub->op)) + break; + if (camel_stub_marshal_decode_uint32 (status_channel, &retval) == -1) break; - + /* FIXME. If you don't have exactly one thing listening * to this, it will get out of sync. But I don't want * CamelStub to have to know the details of the message @@ -118,7 +134,9 @@ camel_object_trigger_event (stub_object, "notification", GUINT_TO_POINTER (retval)); } - + + camel_operation_unregister (stub->op); + return NULL; } Index: camel/camel-stub.h =================================================================== RCS file: /cvs/gnome/evolution-exchange/camel/camel-stub.h,v retrieving revision 1.2 diff -u -r1.2 camel/camel-stub.h --- camel/camel-stub.h 14 Sep 2004 19:28:45 -0000 1.2 +++ camel/camel-stub.h 4 May 2006 19:43:44 -0000 @@ -14,6 +14,8 @@ #endif /* __cplusplus }*/ #include <camel/camel-object.h> +#include <camel/camel-operation.h> + #include "camel-stub-constants.h" #include "camel-stub-marshal.h" #include <pthread.h> @@ -27,9 +29,11 @@ CamelObject parent_object; char *backend_name; - + GMutex *read_lock, *write_lock; CamelStubMarshal *cmd, *status; + + CamelOperation *op; /* for cancelling */ pthread_t status_thread; } CamelStub;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor