[vlc-devel] http access problem with 2.1.0-git-552-gecc0305

Georgi Chorbadzhiyski gf at unixsol.org
Sat Aug 17 20:35:38 CEST 2013


Around 08/17/2013 09:33 PM, Georgi Chorbadzhiyski scribbled:
> Around 08/17/2013 09:28 PM, Georgi Chorbadzhiyski scribbled:
>> Around 08/17/2013 09:24 PM, Georgi Chorbadzhiyski scribbled:
>>> Around 08/17/2013 09:17 PM, Georgi Chorbadzhiyski scribbled:
>>>> Today I updated my vlc to revision 2.1.0-git-552-gecc0305 and it seems
>>>> there is a problem with http access.
>>>
>>> Reverting these four commits that touch src/network/io.c
>>> fixes the bug I'm seeing:
>>>
>>> 9311e60 net_Read: break potential dead lock with waitall = true
>>> e8f36f6 net_Recv(): improve error handling (fixes #9081)
>>> 3328b21 net_Read: rewrite, fix corner cases (fix #8972)
>>> ab7d3c3 net_Gets: rewrite, deal with errors
>>>
>>> I'll try to narrow it down further.
>>
>> The commit that causes problems for me is
>> ab7d3c3 net_Gets: rewrite, deal with errors.
>>
>> git revert ab7d3c3
>>
>> returns http access to working state. I'll try to find the bug...
> 
> The attached patch fixes the issue for me.

A better version is attached.

-- 
Georgi Chorbadzhiyski
http://github.com/gfto/
http://georgi.unixsol.org/
-------------- next part --------------
>From 98fffec8cdcd1c4c7b68cf3fe6d1c7101383a4c6 Mon Sep 17 00:00:00 2001
From: Georgi Chorbadzhiyski <gf at unixsol.org>
Date: Sat, 17 Aug 2013 21:31:51 +0300
Subject: [PATCH] Do not truncate the last character in net_Gets().

---
 src/network/io.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/network/io.c b/src/network/io.c
index 740c990..a8ea870 100644
--- a/src/network/io.c
+++ b/src/network/io.c
@@ -481,9 +481,9 @@ char *net_Gets(vlc_object_t *obj, int fd, const v_socket_t *vs)
         buflen++;
     }
 
-    buf[--buflen] = '\0';
+    buf[buflen] = '\0';
     if (buflen > 0 && buf[buflen - 1] == '\r')
-        buf[buflen] = '\0';
+        buf[buflen - 1] = '\0';
     return buf;
 error:
     free(buf);
-- 
1.8.3.2



More information about the vlc-devel mailing list