Commit Graph

225 Commits

Author SHA1 Message Date
Olivier Dony 14b7e37bf5 [FIX] osv.obj_list is broken via RPC and should not be available anymore
lp bug: https://launchpad.net/bugs/632195 fixed

bzr revid: odo@openerp.com-20101208131328-gycbi36423txdnc1
2010-12-08 14:13:28 +01:00
Olivier Dony 7505e7d822 [FIX] websrv_lib: Darwin webdav workaround
bzr revid: odo@openerp.com-20101124173028-iumdj77clfhsnsuj
2010-11-24 18:30:28 +01:00
P. Christeas 5d53dcc700 websrv_lib: update copyright and remove bogus note
The reference to the "ganeti" project has always been totally arbitrary
and false. It is true that some parts of "websrv_lib" have been based
on Python's BaseHTTPServer and SimpleHTTPServer classes, but not more
than that. Overriding and perhaps resembling to parent classes is the
most common thing in OO programming. But never copied or knew about
any "ganeti" project whatsoever. (actually, the code mentioned at the
url admits itself that it copies the BaseHTTPServer, a common
denominator)

Git history to your help, all the code evolution is clearly recorded.

bzr revid: p_christ@hol.gr-20101123183357-fjroqywizql2qdkk
2010-11-23 20:33:57 +02:00
P. Christeas a2ee48478a websrv_lib: add quirk for Darwin 9.x.x webdav clients.
They will report "HTTP/1.0" to us, while they support (and need) the
authorisation features of HTTP/1.1 .

This makes WebDAV work for some Mac OSX versions.

bzr revid: p_christ@hol.gr-20101123154448-0z7s5o77256cj1tu
2010-11-23 17:44:48 +02:00
P. Christeas 1fed78619f websrv_lib: abort request on partial headers.
While searching for the KTHML bug, noticed that partial http requests
would falsely be honoured. Instead, we must check if the full headers
(including the blank line) have been parsed before we dispatch the
request to the virtual handler class.

Conflicts:

	bin/service/websrv_lib.py

bzr revid: p_christ@hol.gr-20101123153558-oh44mjkhwjaebwow
2010-11-23 17:35:58 +02:00
P. Christeas 1a0a2535a2 http_server: allow requests to "see" the protocol of the server
Needed for WebDAV.

Conflicts:

	bin/service/http_server.py

bzr revid: p_christ@hol.gr-20101123151740-ovx7jg8yp3070qqe
2010-11-23 17:17:40 +02:00
P. Christeas 53c306cfe0 websrv_lib: allow "noconnection" object to carry the socket name
Needed for WebDAV, which wants to know the server's endpoint address.

bzr revid: p_christ@hol.gr-20101123135858-qycopdfqsll1fy38
2010-11-23 15:58:58 +02:00
P. Christeas 091a3eba2b websrv_lib: fix do_OPTIONS for m$ webdav
Since we have moved all code into the websrv_lib, we must also support
this non-standard extension in our do_OPTIONS(). It has been noted that
some Win XP machines wouldn't connect to our WebDAV unless we set that
header.

bzr revid: p_christ@hol.gr-20101123134932-65wmh8bntuwt4jvc
2010-11-23 15:49:32 +02:00
P. Christeas 1f380f0504 web-services: new "get_sqlcount" call
Useful for automated statistics, returns the global SQL counter of queries.
It does not affect any counters, and will print a warning if debug_sql
is not enabled (counter would be zero, then).

bzr revid: p_christ@hol.gr-20101117115232-olq747j4vmauqgy8
2010-11-17 13:52:32 +02:00
P. Christeas cfdd34d511 web_services: implement os timestamp query.
The os user and sys elapsed times are very useful for performance metrics,
they can tell us how much did the openerp server try for some operation.

Conflicts:

	bin/service/web_services.py

bzr revid: p_christ@hol.gr-20101116162025-go5lx4qs658pt7t5
2010-11-16 18:20:25 +02:00
Christophe Simonis 5f3939be3c [FIX] allow modules to register exported services
bzr revid: chs@openerp.com-20101020151557-jjnl3n32lhi4bpox
2010-10-20 17:15:57 +02:00
Olivier Dony 6f5eb0b5b4 [IMP] web_services: better error reporting for report generation issues
bzr revid: odo@openerp.com-20101014135854-ecidlal4qj42ul89
2010-10-14 15:58:54 +02:00
Olivier Dony 68d0f64128 [IMP] netrpc/http servers: consistently name server threads
bzr revid: odo@openerp.com-20100922114631-umxz97owiuvlcf0r
2010-09-22 13:46:31 +02:00
Christophe Simonis 7cf31b4869 [IMP] display database name in the logger
bzr revid: chs@openerp.com-20100903074132-nrhd3p2i53hmtt9j
2010-09-03 09:41:32 +02:00
Olivier Dony 891eb265b6 [REF] config: rationalized config parameters to make consistent for v6.
Renamed parameters for static HTTP service + improved param check message.
+ minor cleanup in config params

bzr revid: odo@openerp.com-20100810131200-p71zge94l1qp1s18
2010-08-10 15:12:00 +02:00
P. Christeas 077e387bb6 [MERGE] service/http: merged some mixed HTTPd changes by xrg, fixes pending
bzr revid: odo@openerp.com-20100809180832-n5ft8a8q2ixm99f2
2010-08-09 20:08:32 +02:00
xrg (P. Christeas) bffc46586f [MERGE] merged xrg's fixes for HTTP auth error codes: access denied is 403
bzr revid: odo@openerp.com-20100804141317-zj2egy7rscq5g35s
2010-08-04 16:13:17 +02:00
P. Christeas, Olivier Dony 7666ac14a7 [MERGE+IMP] logging: merged xrg's branch to set selective logger level + added new 'debug_sql' loglevel to avoid having to modify sql_db.py to enable SQL logging
bzr revid: odo@openerp.com-20100804134900-dfupojmgcj0rjhd2
2010-08-04 15:49:00 +02:00
P. Christeas 9002f47951 HTTPd: fix registering of XML-RPC in a ssl server.
If it has already been registered for httpd, we don't need to do that
again. Otherwise, fix the typo in the args.

bzr revid: p_christ@hol.gr-20100728122909-ahctuv3uyasof1df
2010-07-28 15:29:09 +03:00
Olivier Dony a736c6e17f [ADD] tools.misc: added method to compute client timestamp according to timezone, for example for inclusion in strings where it will not be formatted by the client (do NOT use it when returning date[time] field values to the client!) + refactored timezone_get service method to make it accessible in tools.
bzr revid: odo@openerp.com-20100727152211-mupv9tdhbpv48nvu
2010-07-27 17:22:11 +02:00
P. Christeas a35482142c Httpd: update copyright info
bzr revid: p_christ@hol.gr-20100726093336-1wdzs6scdepk6cqz
2010-07-26 12:33:36 +03:00
P. Christeas d131f6f42d HTTPd, websrv_lib: implement extendable OPTIONS handler.
For CalDAV, we need to allow the handler to fine-tune its OPTIONS response.
So, better cleanup the API and allow request handlers to define their OPTIONS.

bzr revid: p_christ@hol.gr-20100726093336-afzp15rys9oua4a0
2010-07-26 12:33:36 +03:00
P. Christeas e8b1da52ab websrv_lib: fix noconnection.close(), that stub must exist.
bzr revid: p_christ@hol.gr-20100726093336-dom7pcu0a38bxlsb
2010-07-26 12:33:36 +03:00
P. Christeas 018b13240b websrv_lib: Log junk http requests
If a request doesn't start with a valid HTTP request line, log that
whole line.

For some strange reason, kernel 2.6.35-rc3+ triggered xml request lines
to appear.

bzr revid: p_christ@hol.gr-20100726093336-962hxsxoij0pn2ba
2010-07-26 12:33:36 +03:00
P. Christeas 4c6baedf13 netrpc: names at client threads
Have a name for client threads, too.

bzr revid: p_christ@hol.gr-20100726093336-8me0gn4gvexuzk5r
2010-07-26 12:33:36 +03:00
P. Christeas 522df9e236 http server: have names at threads.
A minor improvement, http client threads have a name now.

Conflicts:

	bin/service/http_server.py

bzr revid: p_christ@hol.gr-20100726093335-0p0v34d276u0ks87
2010-07-26 12:33:35 +03:00
P. Christeas bea04e1fc8 Websrv_lib, http_server: have special exception logging
the websrv_lib must conform to the BaseHTTPServer API, that does not
define an exception logging function, nor does it encourage the use
of individual pythonic loggers. So, have a function that is optionally
called, upon exception.

This improves much over the 'log_error()' call, because it allows us
to see all those bugs that would make a http method fail.

bzr revid: p_christ@hol.gr-20100726093335-e3hxsri766o2fzxp
2010-07-26 12:33:35 +03:00
P. Christeas 40758b5222 httpd, netrpcd: do not catch any exceptions
always only catch Exception.

Conflicts:

	bin/service/netrpc_server.py
	bin/service/web_services.py
	bin/service/websrv_lib.py

bzr revid: p_christ@hol.gr-20100726093335-08uzfv3cr9ffx1ue
2010-07-26 12:33:35 +03:00
P. Christeas d0eb1d7516 websrv_lib: fix handling of method exceptions.
They should not consume the body (twice), pass the error to the log(..),
since it may contain '%' characters.

bzr revid: p_christ@hol.gr-20100726093335-wgh34fxda2nt64ze
2010-07-26 12:33:35 +03:00
P. Christeas 7d24059c09 Static http: support OPTIONS
bzr revid: p_christ@hol.gr-20100726093335-6tvao6uzp90mmcnk
2010-07-26 12:33:35 +03:00
P. Christeas 4e36352f5e Http server: support the OPTIONS at the multi-handler.
Now, fixes nautilus trying to browse the server for WebDAV, conforms to
the http standard.
Handlers should better inherit the HttpOptions class and define their
supported options.

bzr revid: p_christ@hol.gr-20100726093335-xzkqw60uyy87mcnq
2010-07-26 12:33:35 +03:00
P. Christeas 59efa51612 static http: use FixSendError.
bzr revid: p_christ@hol.gr-20100726093335-lfq6x0df09vbubv8
2010-07-26 12:33:35 +03:00
P. Christeas 60d11da63e websrv_lib: workaround the send-error of bad handlers
If a handler doesn't inherit FixSendError, it will leave the connection
hanging on a 501 response. Don't trust the handlers.

bzr revid: p_christ@hol.gr-20100726093335-xa0p85vxje63w03k
2010-07-26 12:33:35 +03:00
P. Christeas 754c834d42 websrv_lib: improve sending of internal error
bzr revid: p_christ@hol.gr-20100726093335-n8s6cpjmi2252myf
2010-07-26 12:33:35 +03:00
P. Christeas a405f9a4ef websrv_lib: handle general failures with http 500 status
If some http request fails with an unhandled exception, it is better
to send back the 500 error and close the connection, not leave the client
waiting for a response.

bzr revid: p_christ@hol.gr-20100726093335-o0p4ibon2uvfjxxn
2010-07-26 12:33:35 +03:00
P. Christeas 132ffb246e http: implement stats for http servers.
bzr revid: p_christ@hol.gr-20100726093335-syhvyodg1ec0467f
2010-07-26 12:33:35 +03:00
P. Christeas 9613c0c864 Static httpd: by default, disable. Sample config.
bzr revid: p_christ@hol.gr-20100726093335-m6kfvk8xn2c6ddrh
2010-07-26 12:33:35 +03:00
P. Christeas 0ee47f021c httpd: reduce request logging to debug_rpc level.
This brings back the behaviour of 2 commits ago.

bzr revid: p_christ@hol.gr-20100726093335-d1rdfwsjhdymv8v3
2010-07-26 12:33:35 +03:00
P. Christeas e6ca1be7c3 Http server: better logging
Have a symmetric helper class, that defines logging functions for all
http handlers.

Conflicts:

	bin/service/http_server.py

bzr revid: p_christ@hol.gr-20100726093334-vko7md6hk2004niw
2010-07-26 12:33:34 +03:00
P. Christeas 041f949bcc websrv_lib: one case of cleaner exit.
One rare case, where a module is destructed upon python interpreter exit,
and we need to check.

bzr revid: p_christ@hol.gr-20100726093334-cgirmmldh2mgvovm
2010-07-26 12:33:34 +03:00
P. Christeas ea4bb98140 Feature: serve static http, from a dir
Now, it is possible to serve static http from the files
of one dir. Just configure like:

[static-http]
enable = True
dir_path = /home/panos/build/openerp/doc/build/html

and the contents of that directory will be served as a
default at our http port ;)

Conflicts:

	bin/service/http_server.py

bzr revid: p_christ@hol.gr-20100726093334-2xr5mg0c9xvm68ej
2010-07-26 12:33:34 +03:00
P. Christeas 7d1f26cdd2 Export command to list the http services.
For debugging reasons, we should know what services we have registered
in our multi-dir http server.

Conflicts:

	bin/service/web_services.py

bzr revid: p_christ@hol.gr-20100726093334-7074r91i63e4g7jg
2010-07-26 12:33:34 +03:00
P. Christeas 3e8a845903 Http services: ensure the order in the MultiHandler
If we happen to register the '/' service, and then try to register the
'/webdav/' one, the latter must be inserted before the more generic path.

bzr revid: p_christ@hol.gr-20100726093334-3w7hyaukhzw9xpup
2010-07-26 12:33:34 +03:00
P. Christeas c06b42ad3c HTTP lib: When authentication cannot proceed, issue 403
The http protocol states that 401 should only be used when further
authentication would be possible

bzr revid: p_christ@hol.gr-20100726093334-qe5midzceivezbxu
2010-07-26 12:33:34 +03:00
Olivier Dony 5d16cc715b [IMP] netsvc/netrpc/http_server: introduce timeout for blocking server calls, sort of a busy wait
bzr revid: odo@openerp.com-20100713152244-9jdrem6b2xn50ltt
2010-07-13 17:22:44 +02:00
P. Christeas 09db16f527 Logger: use optional kwargs instead of positional args.
bzr revid: p_christ@hol.gr-20100622111549-sff9q43ahcihgq91
2010-06-22 14:15:49 +03:00
P. Christeas 285e307f25 Logging: Allow rpc to set individual log levels.
bzr revid: p_christ@hol.gr-20100622093547-jax4vg7vp0o6zfz2
2010-06-22 12:35:47 +03:00
P. Christeas 1f16353c11 HTTP lib: When authentication cannot proceed, issue 403
The http protocol states that 401 should only be used when further
authentication would be possible

bzr revid: p_christ@hol.gr-20100622091958-vkpa8wf3lbrt38s9
2010-06-22 12:19:58 +03:00
Harry (OpenERP) 505bbd1dcc [MERGE] attachment: add type: url, binary into ir.attachment
bzr revid: hmo@tinyerp.com-20100629110320-axfcr3nrckv2pr21
2010-06-29 16:33:20 +05:30
P. Christeas 8ed5f3fc75 http_server.py: spacing changes
Conflicts:

	bin/service/http_server.py

bzr revid: p_christ@hol.gr-20100627195425-f79cggbcvi1vmw4z
2010-06-27 22:54:25 +03:00