Re: [E-devel] Add http basic auth to ecore_con_url

2010-03-06 Thread The Rasterman
On Sun, 28 Feb 2010 22:20:53 + Rui Miguel Silva Seabra r...@1407.org said:

 Em 28-02-2010 22:18, Vincent Torri escreveu:
  
  
  On Sun, 28 Feb 2010, Rui Miguel Silva Seabra wrote:
  
  Em 28-02-2010 22:10, Vincent Torri escreveu:
 
 
  On Sun, 28 Feb 2010, Rui Miguel Silva Seabra wrote:
 
  Hello,
 
  The attached patch would seem to add http basic auth to ecore_con_url
 
  I'm still testing it, but I'd like to know the opinion of others on its
  addition. I'm still a bit too shy to commit real code in core EFL
  libraries :)
 
   * don't use asprintf : not portable
 
  Will look into other way to do that part.
  
  buffer + snprintf
 
 I am allocating memory as I don't like to waste space on buffers :)

they are temporary (buffers) whne on the stack - func returns - they go away.
nothing gets fragmented either. unless you put a few hundred kb on the stack -
it doesnt matter. you're not doing micro-cotrollers. it's perfectly fine to do

char buf[4096];
snprintf(buf, sizeof(buf), a:%s, str);

thats just fine - as long as you  expect your styring to norrmally never come
anywhere near the buffer size limit - if it might - you may need ot check. it
may be that some other limit exists anyway (a lot of this stuff uses PATH_MAX
as the os imposes a limit to a path anyway - so if the buffer isnt big enough -
doesnt matter - next level down till spit the dummy anyway).

so choose a reasonable size thats bigger than you may ever reasonably need
and use that.

   * follow the coding style
 
  I thought I did, what did I do wrong?
  
  if ()
{
   int i;// 3 spaces after to column of the opening bracket
}
  
  and use tabs for multiples of 8 spaces. Unfortunately, that horror is
  propagated through all the EFL because of the editor that raster uses.
  The guys who wrote this editor should be tortured.
 
 Oh no, don't drag me into text editor wars ;)
 
 Rui
 
 --
 Download Intel#174; Parallel Studio Eval
 Try the new software tools for yourself. Speed compiling, find bugs
 proactively, and fine-tune applications for parallel performance.
 See why Intel Parallel Studio got high marks during beta.
 http://p.sf.net/sfu/intel-sw-dev
 ___
 enlightenment-devel mailing list
 enlightenment-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
 


-- 
- Codito, ergo sum - I code, therefore I am --
The Rasterman (Carsten Haitzler)ras...@rasterman.com


--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] Add http basic auth to ecore_con_url

2010-03-01 Thread Vincent Torri



On Mon, 1 Mar 2010, Vincent Torri wrote:




On Sun, 28 Feb 2010, Vincent Torri wrote:




On Sun, 28 Feb 2010, Gustavo Sverzut Barbieri wrote:

On Sun, Feb 28, 2010 at 7:10 PM, Vincent Torri vto...@univ-evry.fr 
wrote:

On Sun, 28 Feb 2010, Rui Miguel Silva Seabra wrote:


Hello,

The attached patch would seem to add http basic auth to ecore_con_url

I'm still testing it, but I'd like to know the opinion of others on its
addition. I'm still a bit too shy to commit real code in core EFL
libraries :)


 * don't use asprintf : not portable


as I said in the other mail, I'm pretty sure it is available in other
platforms since I've used it in lots of code I added to SVN.

If not available in windows, it's better to just implement it in evil,
but should be easy to do in 2 pass printf implementation.


and, btw, no, it can't be achieve this way : vsnprintf does not return the 
number of char if the buffer is not sufficiently arge (contrary to the libc 
implentation on linux). It returns -1 in that case


after searching a bit, _vscprintf can be used. I can write an asprintf for 
windows, if it is really needed.


Vincent
--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] Add http basic auth to ecore_con_url

2010-03-01 Thread Gustavo Sverzut Barbieri
On Mon, Mar 1, 2010 at 6:05 AM, Vincent Torri vto...@univ-evry.fr wrote:


 On Mon, 1 Mar 2010, Vincent Torri wrote:



 On Sun, 28 Feb 2010, Vincent Torri wrote:



 On Sun, 28 Feb 2010, Gustavo Sverzut Barbieri wrote:

 On Sun, Feb 28, 2010 at 7:10 PM, Vincent Torri vto...@univ-evry.fr
 wrote:

 On Sun, 28 Feb 2010, Rui Miguel Silva Seabra wrote:

 Hello,

 The attached patch would seem to add http basic auth to ecore_con_url

 I'm still testing it, but I'd like to know the opinion of others on
 its
 addition. I'm still a bit too shy to commit real code in core EFL
 libraries :)

  * don't use asprintf : not portable

 as I said in the other mail, I'm pretty sure it is available in other
 platforms since I've used it in lots of code I added to SVN.

 If not available in windows, it's better to just implement it in evil,
 but should be easy to do in 2 pass printf implementation.

 and, btw, no, it can't be achieve this way : vsnprintf does not return the
 number of char if the buffer is not sufficiently arge (contrary to the libc
 implentation on linux). It returns -1 in that case

 after searching a bit, _vscprintf can be used. I can write an asprintf for
 windows, if it is really needed.

go for it. and if possible, override snprintf with something more standard :-)


-- 
Gustavo Sverzut Barbieri
http://profusion.mobi embedded systems
--
MSN: barbi...@gmail.com
Skype: gsbarbieri
Mobile: +55 (19) 9225-2202

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] Add http basic auth to ecore_con_url

2010-02-28 Thread Vincent Torri


On Sun, 28 Feb 2010, Rui Miguel Silva Seabra wrote:

 Hello,

 The attached patch would seem to add http basic auth to ecore_con_url

 I'm still testing it, but I'd like to know the opinion of others on its
 addition. I'm still a bit too shy to commit real code in core EFL
 libraries :)

  * don't use asprintf : not portable
  * follow the coding style

I let others comment on the code as i don't know much about that stuff

Vincent

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] Add http basic auth to ecore_con_url

2010-02-28 Thread Rui Miguel Silva Seabra
Em 28-02-2010 22:10, Vincent Torri escreveu:
 
 
 On Sun, 28 Feb 2010, Rui Miguel Silva Seabra wrote:
 
 Hello,

 The attached patch would seem to add http basic auth to ecore_con_url

 I'm still testing it, but I'd like to know the opinion of others on its
 addition. I'm still a bit too shy to commit real code in core EFL
 libraries :)
 
  * don't use asprintf : not portable

Will look into other way to do that part.

  * follow the coding style

I thought I did, what did I do wrong?

Rui

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] Add http basic auth to ecore_con_url

2010-02-28 Thread Vincent Torri


On Sun, 28 Feb 2010, Rui Miguel Silva Seabra wrote:

 Em 28-02-2010 22:10, Vincent Torri escreveu:


 On Sun, 28 Feb 2010, Rui Miguel Silva Seabra wrote:

 Hello,

 The attached patch would seem to add http basic auth to ecore_con_url

 I'm still testing it, but I'd like to know the opinion of others on its
 addition. I'm still a bit too shy to commit real code in core EFL
 libraries :)

  * don't use asprintf : not portable

 Will look into other way to do that part.

buffer + snprintf


  * follow the coding style

 I thought I did, what did I do wrong?

if ()
   {
  int i;// 3 spaces after to column of the opening bracket
   }

and use tabs for multiples of 8 spaces. Unfortunately, that horror is 
propagated through all the EFL because of the editor that raster uses. The 
guys who wrote this editor should be tortured.

Vincent

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] Add http basic auth to ecore_con_url

2010-02-28 Thread Rui Miguel Silva Seabra
Em 28-02-2010 22:18, Vincent Torri escreveu:
 
 
 On Sun, 28 Feb 2010, Rui Miguel Silva Seabra wrote:
 
 Em 28-02-2010 22:10, Vincent Torri escreveu:


 On Sun, 28 Feb 2010, Rui Miguel Silva Seabra wrote:

 Hello,

 The attached patch would seem to add http basic auth to ecore_con_url

 I'm still testing it, but I'd like to know the opinion of others on its
 addition. I'm still a bit too shy to commit real code in core EFL
 libraries :)

  * don't use asprintf : not portable

 Will look into other way to do that part.
 
 buffer + snprintf

I am allocating memory as I don't like to waste space on buffers :)

  * follow the coding style

 I thought I did, what did I do wrong?
 
 if ()
   {
  int i;// 3 spaces after to column of the opening bracket
   }
 
 and use tabs for multiples of 8 spaces. Unfortunately, that horror is
 propagated through all the EFL because of the editor that raster uses.
 The guys who wrote this editor should be tortured.

Oh no, don't drag me into text editor wars ;)

Rui

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] Add http basic auth to ecore_con_url

2010-02-28 Thread Joerg Sonnenberger
On Sun, Feb 28, 2010 at 10:02:25PM +, Rui Miguel Silva Seabra wrote:
 The attached patch would seem to add http basic auth to ecore_con_url

Does it work with usernames or passwords containing :?

Joerg

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] Add http basic auth to ecore_con_url

2010-02-28 Thread Gustavo Sverzut Barbieri
On Sun, Feb 28, 2010 at 7:10 PM, Vincent Torri vto...@univ-evry.fr wrote:
 On Sun, 28 Feb 2010, Rui Miguel Silva Seabra wrote:

 Hello,

 The attached patch would seem to add http basic auth to ecore_con_url

 I'm still testing it, but I'd like to know the opinion of others on its
 addition. I'm still a bit too shy to commit real code in core EFL
 libraries :)

  * don't use asprintf : not portable

as I said in the other mail, I'm pretty sure it is available in other
platforms since I've used it in lots of code I added to SVN.

If not available in windows, it's better to just implement it in evil,
but should be easy to do in 2 pass printf implementation.

asprintf() is a very useful function.

BR,

-- 
Gustavo Sverzut Barbieri
http://profusion.mobi embedded systems
--
MSN: barbi...@gmail.com
Skype: gsbarbieri
Mobile: +55 (19) 9225-2202

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] Add http basic auth to ecore_con_url

2010-02-28 Thread Rui Miguel Silva Seabra
Em 28-02-2010 22:25, Joerg Sonnenberger escreveu:
 On Sun, Feb 28, 2010 at 10:02:25PM +, Rui Miguel Silva Seabra wrote:
 The attached patch would seem to add http basic auth to ecore_con_url
 
 Does it work with usernames or passwords containing :?
 
 Joerg

Likely curl won't like it very much, as it sets it to be
username:password\0

I don't think there will be any *trouble* if this isn't controlled, just
a (temporary) limitation.

But working on that is a desireable future change, right now I want to
migrate from using curl directly into using ecore_con_url and I need
basic basic auth support.

Rui

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] Add http basic auth to ecore_con_url

2010-02-28 Thread Vincent Torri



On Sun, 28 Feb 2010, Gustavo Sverzut Barbieri wrote:


On Sun, Feb 28, 2010 at 7:10 PM, Vincent Torri vto...@univ-evry.fr wrote:

On Sun, 28 Feb 2010, Rui Miguel Silva Seabra wrote:


Hello,

The attached patch would seem to add http basic auth to ecore_con_url

I'm still testing it, but I'd like to know the opinion of others on its
addition. I'm still a bit too shy to commit real code in core EFL
libraries :)


 * don't use asprintf : not portable


as I said in the other mail, I'm pretty sure it is available in other
platforms since I've used it in lots of code I added to SVN.

If not available in windows, it's better to just implement it in evil,
but should be easy to do in 2 pass printf implementation.

asprintf() is a very useful function.


and a buffer can also be used, like most of similar code in the efl

Vincent--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] Add http basic auth to ecore_con_url

2010-02-28 Thread Vincent Torri



On Sun, 28 Feb 2010, Vincent Torri wrote:




On Sun, 28 Feb 2010, Gustavo Sverzut Barbieri wrote:


On Sun, Feb 28, 2010 at 7:10 PM, Vincent Torri vto...@univ-evry.fr wrote:

On Sun, 28 Feb 2010, Rui Miguel Silva Seabra wrote:


Hello,

The attached patch would seem to add http basic auth to ecore_con_url

I'm still testing it, but I'd like to know the opinion of others on its
addition. I'm still a bit too shy to commit real code in core EFL
libraries :)


 * don't use asprintf : not portable


as I said in the other mail, I'm pretty sure it is available in other
platforms since I've used it in lots of code I added to SVN.

If not available in windows, it's better to just implement it in evil,
but should be easy to do in 2 pass printf implementation.


and, btw, no, it can't be achieve this way : vsnprintf does not return the 
number of char if the buffer is not sufficiently arge (contrary to the 
libc implentation on linux). It returns -1 in that case


Vincent


asprintf() is a very useful function.


and a buffer can also be used, like most of similar code in the efl

Vincent--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] Add http basic auth to ecore_con_url

2010-02-28 Thread Gustavo Sverzut Barbieri
On Sun, Feb 28, 2010 at 8:13 PM, Vincent Torri vto...@univ-evry.fr wrote:


 On Sun, 28 Feb 2010, Vincent Torri wrote:



 On Sun, 28 Feb 2010, Gustavo Sverzut Barbieri wrote:

 On Sun, Feb 28, 2010 at 7:10 PM, Vincent Torri vto...@univ-evry.fr
 wrote:

 On Sun, 28 Feb 2010, Rui Miguel Silva Seabra wrote:

 Hello,

 The attached patch would seem to add http basic auth to ecore_con_url

 I'm still testing it, but I'd like to know the opinion of others on its
 addition. I'm still a bit too shy to commit real code in core EFL
 libraries :)

  * don't use asprintf : not portable

 as I said in the other mail, I'm pretty sure it is available in other
 platforms since I've used it in lots of code I added to SVN.

 If not available in windows, it's better to just implement it in evil,
 but should be easy to do in 2 pass printf implementation.

 and, btw, no, it can't be achieve this way : vsnprintf does not return the
 number of char if the buffer is not sufficiently arge (contrary to the libc
 implentation on linux). It returns -1 in that case

 Vincent

 asprintf() is a very useful function.

 and a buffer can also be used, like most of similar code in the efl

Ouch, this is quite bad. Maybe evil should provide it's own snprintf()
that is compatible with POSIX and implement the asprintf() variant. I
know I often check the return of snprintf() when I know I can get
bogus value and the result might be truncated (so of no real use) and
I do as the recommended man page says (compare to = sizeof(buf))


-- 
Gustavo Sverzut Barbieri
http://profusion.mobi embedded systems
--
MSN: barbi...@gmail.com
Skype: gsbarbieri
Mobile: +55 (19) 9225-2202

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] Add http basic auth to ecore_con_url

2010-02-28 Thread Vincent Torri



On Sun, 28 Feb 2010, Gustavo Sverzut Barbieri wrote:


On Sun, Feb 28, 2010 at 8:13 PM, Vincent Torri vto...@univ-evry.fr wrote:



On Sun, 28 Feb 2010, Vincent Torri wrote:




On Sun, 28 Feb 2010, Gustavo Sverzut Barbieri wrote:


On Sun, Feb 28, 2010 at 7:10 PM, Vincent Torri vto...@univ-evry.fr
wrote:


On Sun, 28 Feb 2010, Rui Miguel Silva Seabra wrote:


Hello,

The attached patch would seem to add http basic auth to ecore_con_url

I'm still testing it, but I'd like to know the opinion of others on its
addition. I'm still a bit too shy to commit real code in core EFL
libraries :)


 * don't use asprintf : not portable


as I said in the other mail, I'm pretty sure it is available in other
platforms since I've used it in lots of code I added to SVN.

If not available in windows, it's better to just implement it in evil,
but should be easy to do in 2 pass printf implementation.


and, btw, no, it can't be achieve this way : vsnprintf does not return the
number of char if the buffer is not sufficiently arge (contrary to the libc
implentation on linux). It returns -1 in that case

Vincent


asprintf() is a very useful function.


and a buffer can also be used, like most of similar code in the efl


Ouch, this is quite bad. Maybe evil should provide it's own snprintf()
that is compatible with POSIX and implement the asprintf() variant. I
know I often check the return of snprintf() when I know I can get
bogus value and the result might be truncated (so of no real use) and
I do as the recommended man page says (compare to = sizeof(buf))


even worse : snprintf on Windows does not guarantee NULL termination of 
the string...


Vincent--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] Add http basic auth to ecore_con_url

2010-02-28 Thread Joerg Sonnenberger
On Mon, Mar 01, 2010 at 12:13:03AM +0100, Vincent Torri wrote:
 and, btw, no, it can't be achieve this way : vsnprintf does not
 return the number of char if the buffer is not sufficiently arge
 (contrary to the libc implentation on linux). It returns -1 in that
 case

If you mean the function on Windows: don't use it. Not sure about
Windows, but on many other systems you can always implement snprintf in
the crude way by using /dev/null with printf...

Joerg

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel