Re: [Development] QHttp removal

2012-01-04 Thread Peter Hartmann
On 01/03/2012 01:07 PM, ext Thiago Macieira wrote:
 On Tuesday, 3 de January de 2012 09.53.41, Jonas M. Gastal wrote:
 As for removing them entirely yes, it would require changes in the HTTP
 socket  engine and QAuthenticator. But given that both of them use
 QHttpResponseHeader I see no reason to duplicate the code in both classes,
 perphaps it would be preferable to simply strip the not used functionality
 from the existing QHttpResponseHeader class?

 I'm pretty sure that the functionality exists in QNetworkRequestPrivate plus
 the feeding of line by line, found in the QNAM's HTTP engine. We don't need to
 keep even the QHttpResponseHeader class.

I also think the only reason for the old header classes from QHttp to 
still exist is that it is used inside QtNetwork, ideally we want to get 
rid of them altogether and have only one code path for the header files 
(i.e. the one in QNAM)...

Peter





 ___
 Development mailing list
 Development@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/development

___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] QHttp removal

2012-01-04 Thread Jeremy Lainé

Le Jan 4, 2012 à 11:47 AM, Peter Hartmann a écrit :

 On 01/03/2012 01:07 PM, ext Thiago Macieira wrote:
 On Tuesday, 3 de January de 2012 09.53.41, Jonas M. Gastal wrote:
 As for removing them entirely yes, it would require changes in the HTTP
 socket  engine and QAuthenticator. But given that both of them use
 QHttpResponseHeader I see no reason to duplicate the code in both classes,
 perphaps it would be preferable to simply strip the not used functionality
 from the existing QHttpResponseHeader class?
 
 I'm pretty sure that the functionality exists in QNetworkRequestPrivate plus
 the feeding of line by line, found in the QNAM's HTTP engine. We don't need 
 to
 keep even the QHttpResponseHeader class.
 
 I also think the only reason for the old header classes from QHttp to 
 still exist is that it is used inside QtNetwork, ideally we want to get 
 rid of them altogether and have only one code path for the header files 
 (i.e. the one in QNAM)...
 

If it's possible I would really appreciate having a publicly-available class 
for incrementally parsing HTTP requests or responses (with or without the 
initial line).

The use case I have is a Qt-based HTTP-server, but there are probably others..

Jeremy
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] QHttp removal

2012-01-03 Thread Jonas M. Gastal
On Tuesday 03 January 2012 12:33:36 Peter Hartmann wrote:
 I also like first making the parts still in use private; getting rid of
 it completely is a bigger task, as it requires rewriting parts of the
 HTTP socket engine and QAuthenticator IIRC.
 
 Peter
 
 ___
 Development mailing list
 Development@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/development

Peter,

A version that makes the parts still in use private is already done:
http://codereview.qt-project.org/#change,11741

As for removing them entirely yes, it would require changes in the HTTP socket 
engine and QAuthenticator. But given that both of them use QHttpResponseHeader 
I see no reason to duplicate the code in both classes, perphaps it would be 
preferable to simply strip the not used functionality from the existing 
QHttpResponseHeader class?

The qhttpheader_p.h in my patch has two classes QHttpHeader and 
QHttpResponseHeader, I could work on merging and simpĺyfing both of them, what 
do you guys think?

Gastal
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] QHttp removal

2011-12-26 Thread lars.knoll
On 12/23/11 3:39 PM, ext Olivier Goffart oliv...@woboq.com wrote:

On Friday 23 December 2011 09:42:47 Jonas M. Gastal wrote:
 Hey all,
 
 I have just sent to gerrit a patch which removes QHttp from Qt:
 http://codereview.qt-project.org/#change,11741
 
 However I have not removed QHttpHeader and friends, so they're still
public
 and in the QHttp header, I'm wondering if it wouldn't be better to make
that
 stuff private. That API was used in conjunction with QHttp, QNAM doesn't
 require it(in its public API).
 
 We could also consider removing the QHttpHeader* classes entirely but
that
 would entail rewriting all uses of it, there currently are a several.
 
 What does everyone think about that?

I'd say, move that class in qhttpheader_p.h

Yes, let's make it private (or get rid of it if possible). For those that
need/use QHttpHeader (and/or QHttp), we can provide the code as a small
static library that you can include in your code base.

Cheers,
Lars

___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


[Development] QHttp removal

2011-12-23 Thread Jonas M. Gastal
Hey all,

I have just sent to gerrit a patch which removes QHttp from Qt: 
http://codereview.qt-project.org/#change,11741

However I have not removed QHttpHeader and friends, so they're still public 
and in the QHttp header, I'm wondering if it wouldn't be better to make that 
stuff private. That API was used in conjunction with QHttp, QNAM doesn't 
require it(in its public API).

We could also consider removing the QHttpHeader* classes entirely but that 
would entail rewriting all uses of it, there currently are a several.

What does everyone think about that?

Gastal
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] QHttp removal

2011-12-23 Thread Jonas M. Gastal
On Friday 23 December 2011 12:23:14 Alex Kides wrote:
 Is there an equivalent means of processing http requests/responses when
 working with a QTcpServer/QTcpSocket? (The QHttp*Header classes have been
 marked as obsolete but no usable equivalent is in place, that i've seen
 anyway, the QNAM classes don't seem that useful for server type
 applications)
 

QNAM is not meant to be used in creating a server, it is strictly for clients. 
From what I know there are no classes to help in creating an HTTP server(other 
than QTcpServer). While the QHttp*Header classes can be usefull in creating an 
HTTP server I would say they are a far cry from making it easy. If we want to 
add that functionality I think we should wrap it in a much higher level class 
something like QHttpServer. I'm not convinced that that is a good idea tough.

Gastal
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] QHttp removal

2011-12-23 Thread Thiago Macieira
On Friday, 23 de December de 2011 10.41.43, Jonas M. Gastal wrote:
 On Friday 23 December 2011 12:23:14 Alex Kides wrote:
  Is there an equivalent means of processing http requests/responses when
  working with a QTcpServer/QTcpSocket? (The QHttp*Header classes have been
  marked as obsolete but no usable equivalent is in place, that i've seen
  anyway, the QNAM classes don't seem that useful for server type
  applications)

 QNAM is not meant to be used in creating a server, it is strictly for
 clients.
 From what I know there are no classes to help in creating an HTTP
 server(other
 than QTcpServer). While the QHttp*Header classes can be usefull in creating
 an HTTP server I would say they are a far cry from making it easy. If we
 want to add that functionality I think we should wrap it in a much higher
 level class something like QHttpServer. I'm not convinced that that is a
 good idea tough.

QNetworkRequestPrivate has all that is needed to deal with MIME headers. We'd
just need to expose the functionality to parse a header and to recreate one.

--
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
 Intel Sweden AB - Registration Number: 556189-6027
 Knarrarnäsgatan 15, 164 40 Kista, Stockholm, Sweden


signature.asc
Description: This is a digitally signed message part.
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] QHttp removal

2011-12-23 Thread Jonas M. Gastal
On Friday 23 December 2011 11:06:53 Thiago Macieira wrote:
 On Friday, 23 de December de 2011 10.41.43, Jonas M. Gastal wrote:
  QNAM is not meant to be used in creating a server, it is strictly for
  clients.
  
  From what I know there are no classes to help in creating an HTTP
  server(other
  
  than QTcpServer). While the QHttp*Header classes can be usefull in
  creating an HTTP server I would say they are a far cry from making it
  easy. If we want to add that functionality I think we should wrap it in
  a much higher level class something like QHttpServer. I'm not convinced
  that that is a good idea tough.
 
 QNetworkRequestPrivate has all that is needed to deal with MIME headers.
 We'd just need to expose the functionality to parse a header and to
 recreate one.

I only see in QNetworkRequestPrivate code to create headers, I don't see code 
to parse headers.

Gastal
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] QHttp removal

2011-12-23 Thread Olivier Goffart
On Friday 23 December 2011 09:42:47 Jonas M. Gastal wrote:
 Hey all,
 
 I have just sent to gerrit a patch which removes QHttp from Qt:
 http://codereview.qt-project.org/#change,11741
 
 However I have not removed QHttpHeader and friends, so they're still public
 and in the QHttp header, I'm wondering if it wouldn't be better to make that
 stuff private. That API was used in conjunction with QHttp, QNAM doesn't
 require it(in its public API).
 
 We could also consider removing the QHttpHeader* classes entirely but that
 would entail rewriting all uses of it, there currently are a several.
 
 What does everyone think about that?

I'd say, move that class in qhttpheader_p.h

___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development