Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 85776 Details for
Bug 131603
app-mobilephone/obexftp hangs when sending file to Sony Ericsson z520 over usb cable using cdc_acm
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
obexftp-0.19-cobex_write.patch
obexftp-0.19-cobex_write.patch (text/plain), 2.24 KB, created by
Alin Năstac (RETIRED)
on 2006-04-29 11:19:53 UTC
(
hide
)
Description:
obexftp-0.19-cobex_write.patch
Filename:
MIME Type:
Creator:
Alin Năstac (RETIRED)
Created:
2006-04-29 11:19:53 UTC
Size:
2.24 KB
patch
obsolete
>diff -Nru obexftp-0.19.orig/multicobex/multi_cobex.c obexftp-0.19/multicobex/multi_cobex.c >--- obexftp-0.19.orig/multicobex/multi_cobex.c 2005-11-24 16:55:11.000000000 +0200 >+++ obexftp-0.19/multicobex/multi_cobex.c 2006-04-29 21:13:47.955525000 +0300 >@@ -126,7 +126,7 @@ > /* Called from OBEX-lib when data needs to be written */ > int cobex_write(obex_t *self, void *data, uint8_t *buffer, int length) > { >- int actual; >+ int written; > cobex_t *c; > return_val_if_fail (self != NULL, -1); > return_val_if_fail (data != NULL, -1); >@@ -137,24 +137,37 @@ > DEBUG(3, "%s() Data %d bytes\n", __func__, length); > > if (c->type == CT_ERICSSON || c->type == CT_SIEMENS) { >- actual = write(c->fd, buffer, length); >- if (actual < length) { >- DEBUG(1, "Error writing to port (%d expected %d)\n", actual, length); >- return actual; /* or -1? */ >+ int retries=0, chunk, fails=0; >+ written = 0; >+ for (retries = 0; written < length; retries++) { >+ chunk = write(c->fd, buffer+written, length-written); >+ if (chunk <= 0) { >+ if ( ++fails >= 10 ) { // to avoid infinite looping if something is really wrong >+ DEBUG(1, "%s() Error writing to port (written %d bytes out of %d, in %d retries)\n", __func__, written, length, retries); >+ return written; >+ } >+ usleep(1); // This mysteriously avoids a resource not available error on write() >+ } else { >+ written += chunk; >+ fails = 0; // Reset error counter on successful write op >+ } > } >- return actual; >+ >+ if (retries > 0) >+ DEBUG(2, "%s() Wrote %d bytes in %d retries\n", __func__, written, retries); >+ return written; > } > > if (c->seq == 0){ >- actual = bfb_send_first(c->fd, buffer, length); >- DEBUG(2, "%s() Wrote %d first packets (%d bytes)\n", __func__, actual, length); >+ written = bfb_send_first(c->fd, buffer, length); >+ DEBUG(2, "%s() Wrote %d first packets (%d bytes)\n", __func__, written, length); > } else { >- actual = bfb_send_next(c->fd, buffer, length, c->seq); >- DEBUG(2, "%s() Wrote %d packets (%d bytes)\n", __func__, actual, length); >+ written = bfb_send_next(c->fd, buffer, length, c->seq); >+ DEBUG(2, "%s() Wrote %d packets (%d bytes)\n", __func__, written, length); > } > c->seq++; > >- return actual; >+ return written; > } > > /* Called when input data is needed */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 131603
:
85692
|
85693
|
85695
| 85776