Only in open-source2/openobex/dist/lib: .deps
Only in open-source2/openobex/dist/lib: .libs
Only in open-source2/openobex/dist/lib: Makefile
diff -crB open-source/openobex/dist/lib/obex_client.c open-source2/openobex/dist/lib/obex_client.c
*** open-source/openobex/dist/lib/obex_client.c	Thu Jan  3 10:48:33 2008
--- open-source2/openobex/dist/lib/obex_client.c	Thu Jan  3 13:24:18 2008
***************
*** 67,73 ****
  		   every fragment sent so we have to accept that too.*/
  		if(rsp != OBEX_RSP_SUCCESS && rsp != OBEX_RSP_CONTINUE) {
  			DEBUG(0, "STATE_SEND. request not accepted.\n");
! 			obex_deliver_event(self, OBEX_EV_REQDONE, self->object->opcode, rsp, TRUE);
  			/* This is not an Obex error, it is just that the peer
  			 * doesn't accept the request, so return 0 - Jean II */
  			return 0;
--- 67,73 ----
  		   every fragment sent so we have to accept that too.*/
  		if(rsp != OBEX_RSP_SUCCESS && rsp != OBEX_RSP_CONTINUE) {
  			DEBUG(0, "STATE_SEND. request not accepted.\n");
! 			obex_deliver_event(self, OBEX_EV_REQDONE, self->object->opcode, rsp, TRUE, OBEX_MODE_CLIENT);
  			/* This is not an Obex error, it is just that the peer
  			 * doesn't accept the request, so return 0 - Jean II */
  			return 0;
***************
*** 98,107 ****
  			if((self->object->opcode == OBEX_CMD_CONNECT) ||
  			   (obex_object_receive(self, msg) < 0))	{
  				self->state = MODE_SRV | STATE_IDLE;
! 				obex_deliver_event(self, OBEX_EV_PARSEERR, self->object->opcode, 0, TRUE);
  				return -1;
  			}
! 			obex_deliver_event(self, OBEX_EV_UNEXPECTED, self->object->opcode, 0, FALSE);
  			/* Note : we may want to get rid of received header,
  			 * however they are mixed with legitimate headers,
  			 * and the user may expect to consult them later.
--- 98,107 ----
  			if((self->object->opcode == OBEX_CMD_CONNECT) ||
  			   (obex_object_receive(self, msg) < 0))	{
  				self->state = MODE_SRV | STATE_IDLE;
! 				obex_deliver_event(self, OBEX_EV_PARSEERR, self->object->opcode, 0, TRUE, OBEX_MODE_CLIENT);
  				return -1;
  			}
! 			obex_deliver_event(self, OBEX_EV_UNEXPECTED, self->object->opcode, 0, FALSE, OBEX_MODE_CLIENT);
  			/* Note : we may want to get rid of received header,
  			 * however they are mixed with legitimate headers,
  			 * and the user may expect to consult them later.
***************
*** 117,127 ****
  		if(ret < 0) {
  			/* Error while sending */
  			self->state = MODE_CLI | STATE_IDLE;
! 			obex_deliver_event(self, OBEX_EV_LINKERR, self->object->opcode, 0, TRUE);
  		}
  		else if (ret == 0) {
  			/* Some progress made */			
! 			obex_deliver_event(self, OBEX_EV_PROGRESS, self->object->opcode, 0, FALSE);
                  	self->state = MODE_CLI | STATE_SEND;
  		}
                  else {
--- 117,127 ----
  		if(ret < 0) {
  			/* Error while sending */
  			self->state = MODE_CLI | STATE_IDLE;
! 			obex_deliver_event(self, OBEX_EV_LINKERR, self->object->opcode, 0, TRUE, OBEX_MODE_CLIENT);
  		}
  		else if (ret == 0) {
  			/* Some progress made */			
! 			obex_deliver_event(self, OBEX_EV_PROGRESS, self->object->opcode, 0, FALSE, OBEX_MODE_CLIENT);
                  	self->state = MODE_CLI | STATE_SEND;
  		}
                  else {
***************
*** 141,147 ****
  			DEBUG(2, "We expect a connect-rsp\n");
  			if(obex_parse_connect_header(self, msg) < 0)	{
  				self->state = MODE_SRV | STATE_IDLE;
! 				obex_deliver_event(self, OBEX_EV_PARSEERR, self->object->opcode, 0, TRUE);
  				return -1;
  			}
  			self->object->headeroffset=4;
--- 141,147 ----
  			DEBUG(2, "We expect a connect-rsp\n");
  			if(obex_parse_connect_header(self, msg) < 0)	{
  				self->state = MODE_SRV | STATE_IDLE;
! 				obex_deliver_event(self, OBEX_EV_PARSEERR, self->object->opcode, 0, TRUE, OBEX_MODE_CLIENT);
  				return -1;
  			}
  			self->object->headeroffset=4;
***************
*** 156,162 ****
  		/* Receive any headers */
  		if(obex_object_receive(self, msg) < 0)	{
  			self->state = MODE_SRV | STATE_IDLE;
! 			obex_deliver_event(self, OBEX_EV_PARSEERR, self->object->opcode, 0, TRUE);
  			return -1;
  		}
  	
--- 156,162 ----
  		/* Receive any headers */
  		if(obex_object_receive(self, msg) < 0)	{
  			self->state = MODE_SRV | STATE_IDLE;
! 			obex_deliver_event(self, OBEX_EV_PARSEERR, self->object->opcode, 0, TRUE, OBEX_MODE_CLIENT);
  			return -1;
  		}
  	
***************
*** 177,207 ****
  			}
  
  			if (obex_object_send(self, self->object, TRUE, FALSE) < 0)
! 				obex_deliver_event(self, OBEX_EV_LINKERR, self->object->opcode, 0, TRUE);
  			else
! 				obex_deliver_event(self, OBEX_EV_PROGRESS, self->object->opcode, 0, FALSE);
  
  			self->object->continue_received = 0;
  		} else {
  			/* Notify app that client-operation is done! */
  			DEBUG(3, "Done! Rsp=%02x!\n", rsp);
  			if (self->object->abort) {
- 				self->state = MODE_SRV | STATE_IDLE;
  				if (rsp == OBEX_RSP_SUCCESS)
! 					obex_deliver_event(self, OBEX_EV_ABORT, self->object->opcode, rsp, TRUE);
  				else
! 					obex_deliver_event(self, OBEX_EV_LINKERR, self->object->opcode, rsp, TRUE);
  			}
  			else {
! 				obex_deliver_event(self, OBEX_EV_REQDONE, self->object->opcode, rsp, TRUE);
! 				self->state = MODE_SRV | STATE_IDLE;
  			}
  		}
  		break;
         	
         	default:
  		DEBUG(0, "Unknown state\n");		
! 		obex_deliver_event(self, OBEX_EV_PARSEERR, rsp, 0, TRUE);
  		return -1;
  	}
  
--- 177,206 ----
  			}
  
  			if (obex_object_send(self, self->object, TRUE, FALSE) < 0)
! 				obex_deliver_event(self, OBEX_EV_LINKERR, self->object->opcode, 0, TRUE, OBEX_MODE_CLIENT);
  			else
! 				obex_deliver_event(self, OBEX_EV_PROGRESS, self->object->opcode, 0, FALSE, OBEX_MODE_CLIENT);
  
  			self->object->continue_received = 0;
  		} else {
  			/* Notify app that client-operation is done! */
  			DEBUG(3, "Done! Rsp=%02x!\n", rsp);
+ 			self->state = MODE_SRV | STATE_IDLE;
  			if (self->object->abort) {
  				if (rsp == OBEX_RSP_SUCCESS)
! 					obex_deliver_event(self, OBEX_EV_ABORT, self->object->opcode, rsp, TRUE, OBEX_MODE_CLIENT);
  				else
! 					obex_deliver_event(self, OBEX_EV_LINKERR, self->object->opcode, rsp, TRUE, OBEX_MODE_CLIENT);
  			}
  			else {
! 				obex_deliver_event(self, OBEX_EV_REQDONE, self->object->opcode, rsp, TRUE, OBEX_MODE_CLIENT);
  			}
  		}
  		break;
         	
         	default:
  		DEBUG(0, "Unknown state\n");		
! 		obex_deliver_event(self, OBEX_EV_PARSEERR, rsp, 0, TRUE, OBEX_MODE_CLIENT);
  		return -1;
  	}
  
diff -crB open-source/openobex/dist/lib/obex_main.c open-source2/openobex/dist/lib/obex_main.c
*** open-source/openobex/dist/lib/obex_main.c	Thu Jan  3 10:48:33 2008
--- open-source2/openobex/dist/lib/obex_main.c	Thu Jan  3 13:25:02 2008
***************
*** 174,190 ****
   *    Deliver an event to app.
   *
   */
! void obex_deliver_event(obex_t *self, int event, int cmd, int rsp, int del)
  {
  	obex_object_t *object = self->object;
  
  	if (del == TRUE)
  		self->object = NULL;
  
! 	if (self->state & MODE_SRV)
! 		self->eventcb(self, object, OBEX_MODE_SERVER, event, cmd, rsp);
! 	else
! 		self->eventcb(self, object, OBEX_MODE_CLIENT, event, cmd, rsp);
  	
  	if (del == TRUE)
  		obex_object_delete(object);
--- 174,187 ----
   *    Deliver an event to app.
   *
   */
! void obex_deliver_event(obex_t *self, int event, int cmd, int rsp, int del, int mode)
  {
  	obex_object_t *object = self->object;
  
  	if (del == TRUE)
  		self->object = NULL;
  
! 	self->eventcb(self, object, mode, event, cmd, rsp);
  	
  	if (del == TRUE)
  		obex_object_delete(object);
***************
*** 263,269 ****
  
  		/* Check if we are still connected */
  		if (actual <= 0)	{
! 			obex_deliver_event(self, OBEX_EV_LINKERR, 0, 0, TRUE);
  			return actual;
  		}
  		buf += actual;
--- 260,266 ----
  
  		/* Check if we are still connected */
  		if (actual <= 0)	{
! 			obex_deliver_event(self, OBEX_EV_LINKERR, 0, 0, TRUE, self->state & MODE_SRV ? OBEX_MODE_SERVER : OBEX_MODE_CLIENT);
  			return actual;
  		}
  		buf += actual;
***************
*** 283,289 ****
  
  			/* Check if we are still connected */
  			if (actual <= 0)	{
! 				obex_deliver_event(self, OBEX_EV_LINKERR, 0, 0, TRUE);
  				return actual;
  			}
  		}
--- 280,286 ----
  
  			/* Check if we are still connected */
  			if (actual <= 0)	{
! 				obex_deliver_event(self, OBEX_EV_LINKERR, 0, 0, TRUE, self->state & MODE_SRV ? OBEX_MODE_SERVER : OBEX_MODE_CLIENT);
  				return actual;
  			}
  		}
***************
*** 349,361 ****
  	/* Abort request without sending abort */
  	if (!nice) {
  		/* Deliver event will delete the object */
! 		obex_deliver_event(self, OBEX_EV_ABORT, 0, 0, TRUE);
  		buf_reuse(self->tx_msg);
  		buf_reuse(self->rx_msg);
  		/* Since we didn't send ABORT to peer we are out of sync
  		   and need to disconnect transport immediately, so we signal
  		   link error to app */
! 		obex_deliver_event(self, OBEX_EV_LINKERR, 0, 0, FALSE);
  		return 1;
  	} else {
  		obex_object_t *object;
--- 346,358 ----
  	/* Abort request without sending abort */
  	if (!nice) {
  		/* Deliver event will delete the object */
! 		obex_deliver_event(self, OBEX_EV_ABORT, 0, 0, TRUE, self->state & MODE_SRV ? OBEX_MODE_SERVER : OBEX_MODE_CLIENT);
  		buf_reuse(self->tx_msg);
  		buf_reuse(self->rx_msg);
  		/* Since we didn't send ABORT to peer we are out of sync
  		   and need to disconnect transport immediately, so we signal
  		   link error to app */
! 		obex_deliver_event(self, OBEX_EV_LINKERR, 0, 0, FALSE, self->state & MODE_SRV ? OBEX_MODE_SERVER : OBEX_MODE_CLIENT);
  		return 1;
  	} else {
  		obex_object_t *object;
diff -crB open-source/openobex/dist/lib/obex_main.h open-source2/openobex/dist/lib/obex_main.h
*** open-source/openobex/dist/lib/obex_main.h	Thu Jan  3 10:48:33 2008
--- open-source2/openobex/dist/lib/obex_main.h	Mon Dec  3 11:47:59 2007
***************
*** 148,154 ****
  int obex_create_socket(obex_t *self, int domain);
  int obex_delete_socket(obex_t *self, int fd);
  
! void obex_deliver_event(obex_t *self, int event, int cmd, int rsp, int del);
  int obex_data_indication(obex_t *self, uint8_t *buf, int buflen);
  
  void obex_response_request(obex_t *self, uint8_t opcode);
--- 148,154 ----
  int obex_create_socket(obex_t *self, int domain);
  int obex_delete_socket(obex_t *self, int fd);
  
! void obex_deliver_event(obex_t *self, int event, int cmd, int rsp, int del, int mode);
  int obex_data_indication(obex_t *self, uint8_t *buf, int buflen);
  
  void obex_response_request(obex_t *self, uint8_t opcode);
diff -crB open-source/openobex/dist/lib/obex_object.c open-source2/openobex/dist/lib/obex_object.c
*** open-source/openobex/dist/lib/obex_object.c	Thu Jan  3 10:48:33 2008
--- open-source2/openobex/dist/lib/obex_object.c	Mon Dec  3 11:52:22 2007
***************
*** 302,308 ****
  			/* Ask app for more data if no more */
  			object->s_offset = 0;
  			object->s_buf = NULL;
! 			obex_deliver_event(self, OBEX_EV_STREAMEMPTY, 0, 0, FALSE);
  			DEBUG(4, "s_len=%d, s_stop = %d\n",
  						object->s_len, object->s_stop);
  			/* End of stream ?*/
--- 302,308 ----
  			/* Ask app for more data if no more */
  			object->s_offset = 0;
  			object->s_buf = NULL;
! 			obex_deliver_event(self, OBEX_EV_STREAMEMPTY, 0, 0, FALSE, self->state & MODE_SRV ? OBEX_MODE_SERVER : OBEX_MODE_CLIENT);
  			DEBUG(4, "s_len=%d, s_stop = %d\n",
  						object->s_len, object->s_stop);
  			/* End of stream ?*/
***************
*** 667,679 ****
  	}
  	
  	/* Notify app that data has arrived */
! 	obex_deliver_event(self, OBEX_EV_STREAMAVAIL, 0, 0, FALSE);
  	
  	/* If send send EOS to app */
  	if(hi == OBEX_HDR_BODY_END && len != 0) {
  		object->s_buf = source;
  		object->s_len = 0;
! 		obex_deliver_event(self, OBEX_EV_STREAMAVAIL, 0, 0, FALSE);
  	}
  }
  
--- 667,679 ----
  	}
  	
  	/* Notify app that data has arrived */
! 	obex_deliver_event(self, OBEX_EV_STREAMAVAIL, 0, 0, FALSE, self->state & MODE_SRV ? OBEX_MODE_SERVER : OBEX_MODE_CLIENT);
  	
  	/* If send send EOS to app */
  	if(hi == OBEX_HDR_BODY_END && len != 0) {
  		object->s_buf = source;
  		object->s_len = 0;
! 		obex_deliver_event(self, OBEX_EV_STREAMAVAIL, 0, 0, FALSE, self->state & MODE_SRV ? OBEX_MODE_SERVER : OBEX_MODE_CLIENT);
  	}
  }
  
***************
*** 940,948 ****
   		return 0;
  
  	if (obex_object_send(self, object, TRUE, FALSE) < 0)
! 		obex_deliver_event(self, OBEX_EV_LINKERR, object->opcode, 0, TRUE);
  	else
! 		obex_deliver_event(self, OBEX_EV_PROGRESS, object->opcode, 0, FALSE);
  
  	self->state = MODE_CLI | STATE_REC;
  	object->first_packet_sent = 1;
--- 940,948 ----
   		return 0;
  
  	if (obex_object_send(self, object, TRUE, FALSE) < 0)
! 		obex_deliver_event(self, OBEX_EV_LINKERR, object->opcode, 0, TRUE, self->state & MODE_SRV ? OBEX_MODE_SERVER : OBEX_MODE_CLIENT);
  	else
! 		obex_deliver_event(self, OBEX_EV_PROGRESS, object->opcode, 0, FALSE, self->state & MODE_SRV ? OBEX_MODE_SERVER : OBEX_MODE_CLIENT);
  
  	self->state = MODE_CLI | STATE_REC;
  	object->first_packet_sent = 1;
diff -crB open-source/openobex/dist/lib/obex_server.c open-source2/openobex/dist/lib/obex_server.c
*** open-source/openobex/dist/lib/obex_server.c	Thu Jan  3 10:48:33 2008
--- open-source2/openobex/dist/lib/obex_server.c	Mon Dec  3 11:47:26 2007
***************
*** 84,90 ****
  		/* Hint app that something is about to come so that
  		   the app can deny a PUT-like request early, or
  		   set the header-offset */
! 		obex_deliver_event(self, OBEX_EV_REQHINT, cmd, 0, FALSE);
  						
  		/* Some commands needs special treatment (data outside headers) */
  		switch(cmd)	{
--- 84,90 ----
  		/* Hint app that something is about to come so that
  		   the app can deny a PUT-like request early, or
  		   set the header-offset */
! 		obex_deliver_event(self, OBEX_EV_REQHINT, cmd, 0, FALSE, OBEX_MODE_SERVER);
  						
  		/* Some commands needs special treatment (data outside headers) */
  		switch(cmd)	{
***************
*** 93,99 ****
  			/* Connect needs some extra special treatment */
  			if(obex_parse_connect_header(self, msg) < 0) {
  				obex_response_request(self, OBEX_RSP_BAD_REQUEST);
! 				obex_deliver_event(self, OBEX_EV_PARSEERR, self->object->opcode, 0, TRUE);
  				return -1;
  			}
  			self->object->headeroffset = 4;
--- 93,99 ----
  			/* Connect needs some extra special treatment */
  			if(obex_parse_connect_header(self, msg) < 0) {
  				obex_response_request(self, OBEX_RSP_BAD_REQUEST);
! 				obex_deliver_event(self, OBEX_EV_PARSEERR, self->object->opcode, 0, TRUE, OBEX_MODE_SERVER);
  				return -1;
  			}
  			self->object->headeroffset = 4;
***************
*** 115,121 ****
  			DEBUG(1, "Got OBEX_ABORT request!\n");
  			obex_response_request(self, OBEX_RSP_SUCCESS);
  			self->state = MODE_SRV | STATE_IDLE;
! 			obex_deliver_event(self, OBEX_EV_ABORT, self->object->opcode, cmd, TRUE);
  			/* This is not an Obex error, it is just that the peer
  			 * aborted the request, so return 0 - Jean II */
  			return 0;
--- 115,121 ----
  			DEBUG(1, "Got OBEX_ABORT request!\n");
  			obex_response_request(self, OBEX_RSP_SUCCESS);
  			self->state = MODE_SRV | STATE_IDLE;
! 			obex_deliver_event(self, OBEX_EV_ABORT, self->object->opcode, cmd, TRUE, OBEX_MODE_SERVER);
  			/* This is not an Obex error, it is just that the peer
  			 * aborted the request, so return 0 - Jean II */
  			return 0;
***************
*** 127,133 ****
  			   same as int the first fragment. Bail out! */
  			obex_response_request(self, OBEX_RSP_BAD_REQUEST);
  			self->state = MODE_SRV | STATE_IDLE;
! 			obex_deliver_event(self, OBEX_EV_PARSEERR, self->object->opcode, cmd, TRUE);
  			return -1;
  		}
  		
--- 127,133 ----
  			   same as int the first fragment. Bail out! */
  			obex_response_request(self, OBEX_RSP_BAD_REQUEST);
  			self->state = MODE_SRV | STATE_IDLE;
! 			obex_deliver_event(self, OBEX_EV_PARSEERR, self->object->opcode, cmd, TRUE, OBEX_MODE_SERVER);
  			return -1;
  		}
  		
***************
*** 135,141 ****
  		if(obex_object_receive(self, msg) < 0)	{
  			obex_response_request(self, OBEX_RSP_BAD_REQUEST);
  			self->state = MODE_SRV | STATE_IDLE;
! 			obex_deliver_event(self, OBEX_EV_PARSEERR, self->object->opcode, 0, TRUE);
  			return -1;
  		}
  
--- 135,141 ----
  		if(obex_object_receive(self, msg) < 0)	{
  			obex_response_request(self, OBEX_RSP_BAD_REQUEST);
  			self->state = MODE_SRV | STATE_IDLE;
! 			obex_deliver_event(self, OBEX_EV_PARSEERR, self->object->opcode, 0, TRUE, OBEX_MODE_SERVER);
  			return -1;
  		}
  
***************
*** 143,149 ****
  			/* Let the user decide whether to accept or deny a multi-packet
  			 * request by examining all headers in the first packet */
  			if (!self->object->checked) {
! 				obex_deliver_event(self, OBEX_EV_REQCHECK, cmd, 0, FALSE);
  				self->object->checked = 1;                       
  			}
  
--- 143,149 ----
  			/* Let the user decide whether to accept or deny a multi-packet
  			 * request by examining all headers in the first packet */
  			if (!self->object->checked) {
! 				obex_deliver_event(self, OBEX_EV_REQCHECK, cmd, 0, FALSE, OBEX_MODE_SERVER);
  				self->object->checked = 1;                       
  			}
  
***************
*** 164,174 ****
  		if(!final) {
  			/* As a server, the final bit is always SET- Jean II */
  			if(obex_object_send(self, self->object, FALSE, TRUE) < 0) {
! 				obex_deliver_event(self, OBEX_EV_LINKERR, cmd, 0, TRUE);
  				return -1;
  			}			
  			else {
! 				obex_deliver_event(self, OBEX_EV_PROGRESS, cmd, 0, FALSE);
  			}
  			break; /* Stay in this state if not final */
  		}
--- 164,174 ----
  		if(!final) {
  			/* As a server, the final bit is always SET- Jean II */
  			if(obex_object_send(self, self->object, FALSE, TRUE) < 0) {
! 				obex_deliver_event(self, OBEX_EV_LINKERR, cmd, 0, TRUE, OBEX_MODE_SERVER);
  				return -1;
  			}			
  			else {
! 				obex_deliver_event(self, OBEX_EV_PROGRESS, cmd, 0, FALSE, OBEX_MODE_SERVER);
  			}
  			break; /* Stay in this state if not final */
  		}
***************
*** 182,188 ****
  			   this event is delivered the app should append the
  			   headers that should be in the response */
  			if (!deny)
! 				obex_deliver_event(self, OBEX_EV_REQ, cmd, 0, FALSE);
  			self->state = MODE_SRV | STATE_SEND;
  			len = 3; /* Otherwise sanitycheck later will fail */
  		}
--- 182,188 ----
  			   this event is delivered the app should append the
  			   headers that should be in the response */
  			if (!deny)
! 				obex_deliver_event(self, OBEX_EV_REQ, cmd, 0, FALSE, OBEX_MODE_SERVER);
  			self->state = MODE_SRV | STATE_SEND;
  			len = 3; /* Otherwise sanitycheck later will fail */
  		}
***************
*** 197,203 ****
  			DEBUG(1, "Got OBEX_ABORT request!\n");
  			obex_response_request(self, OBEX_RSP_SUCCESS);
  			self->state = MODE_SRV | STATE_IDLE;
! 			obex_deliver_event(self, OBEX_EV_ABORT, self->object->opcode, cmd, TRUE);
  			/* This is not an Obex error, it is just that the peer
  			 * aborted the request, so return 0 - Jean II */
  			return 0;		
--- 197,203 ----
  			DEBUG(1, "Got OBEX_ABORT request!\n");
  			obex_response_request(self, OBEX_RSP_SUCCESS);
  			self->state = MODE_SRV | STATE_IDLE;
! 			obex_deliver_event(self, OBEX_EV_ABORT, self->object->opcode, cmd, TRUE, OBEX_MODE_SERVER);
  			/* This is not an Obex error, it is just that the peer
  			 * aborted the request, so return 0 - Jean II */
  			return 0;		
***************
*** 230,239 ****
  			   (obex_object_receive(self, msg) < 0))	{
  				obex_response_request(self, OBEX_RSP_BAD_REQUEST);
  				self->state = MODE_SRV | STATE_IDLE;
! 				obex_deliver_event(self, OBEX_EV_PARSEERR, self->object->opcode, 0, TRUE);
  				return -1;
  			}
! 			obex_deliver_event(self, OBEX_EV_UNEXPECTED, self->object->opcode, 0, FALSE);
  			/* Note : we may want to get rid of received header,
  			 * however they are mixed with legitimate headers,
  			 * and the user may expect to consult them later.
--- 230,239 ----
  			   (obex_object_receive(self, msg) < 0))	{
  				obex_response_request(self, OBEX_RSP_BAD_REQUEST);
  				self->state = MODE_SRV | STATE_IDLE;
! 				obex_deliver_event(self, OBEX_EV_PARSEERR, self->object->opcode, 0, TRUE, OBEX_MODE_SERVER);
  				return -1;
  			}
! 			obex_deliver_event(self, OBEX_EV_UNEXPECTED, self->object->opcode, 0, FALSE, OBEX_MODE_SERVER);
  			/* Note : we may want to get rid of received header,
  			 * however they are mixed with legitimate headers,
  			 * and the user may expect to consult them later.
***************
*** 250,260 ****
  		ret = obex_object_send(self, self->object, TRUE, TRUE);
  		if(ret == 0) {
  			/* Made some progress */
! 			obex_deliver_event(self, OBEX_EV_PROGRESS, cmd, 0, FALSE);
  		}
  		else if(ret < 0) {
  			/* Error sending response */
! 			obex_deliver_event(self, OBEX_EV_LINKERR, cmd, 0, TRUE);
  			return -1;
  		}
  		else {
--- 250,260 ----
  		ret = obex_object_send(self, self->object, TRUE, TRUE);
  		if(ret == 0) {
  			/* Made some progress */
! 			obex_deliver_event(self, OBEX_EV_PROGRESS, cmd, 0, FALSE, OBEX_MODE_SERVER);
  		}
  		else if(ret < 0) {
  			/* Error sending response */
! 			obex_deliver_event(self, OBEX_EV_LINKERR, cmd, 0, TRUE, OBEX_MODE_SERVER);
  			return -1;
  		}
  		else {
***************
*** 264,277 ****
  				self->mtu_tx = OBEX_MINIMUM_MTU;
  			}
  			self->state = MODE_SRV | STATE_IDLE;
! 			obex_deliver_event(self, OBEX_EV_REQDONE, cmd, 0, TRUE);
  		}
  		break;
  	
  	default:
  		DEBUG(0, "Unknown state\n");
  		obex_response_request(self, OBEX_RSP_BAD_REQUEST);
! 		obex_deliver_event(self, OBEX_EV_PARSEERR, cmd, 0, TRUE);
  		return -1;
  	}
  	return 0;
--- 264,277 ----
  				self->mtu_tx = OBEX_MINIMUM_MTU;
  			}
  			self->state = MODE_SRV | STATE_IDLE;
! 			obex_deliver_event(self, OBEX_EV_REQDONE, cmd, 0, TRUE, OBEX_MODE_SERVER);
  		}
  		break;
  	
  	default:
  		DEBUG(0, "Unknown state\n");
  		obex_response_request(self, OBEX_RSP_BAD_REQUEST);
! 		obex_deliver_event(self, OBEX_EV_PARSEERR, cmd, 0, TRUE, OBEX_MODE_SERVER);
  		return -1;
  	}
  	return 0;
diff -crB open-source/openobex/dist/lib/obex_transport.c open-source2/openobex/dist/lib/obex_transport.c
*** open-source/openobex/dist/lib/obex_transport.c	Thu Jan  3 10:48:33 2008
--- open-source2/openobex/dist/lib/obex_transport.c	Mon Dec  3 11:53:21 2007
***************
*** 121,127 ****
  			/* Tell the app to perform the OBEX_Accept() */
  			if(self->keepserver)
  				obex_deliver_event(self, OBEX_EV_ACCEPTHINT,
! 						   0, 0, FALSE);
  			/* Otherwise, just disconnect the server */
  			if((ret >= 0) && (! self->keepserver)) {
  				obex_transport_disconnect_server(self);
--- 121,127 ----
  			/* Tell the app to perform the OBEX_Accept() */
  			if(self->keepserver)
  				obex_deliver_event(self, OBEX_EV_ACCEPTHINT,
! 						   0, 0, FALSE, OBEX_MODE_SERVER);
  			/* Otherwise, just disconnect the server */
  			if((ret >= 0) && (! self->keepserver)) {
  				obex_transport_disconnect_server(self);
