Commit Graph

213 Commits

Author SHA1 Message Date
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
Olivier Dony ef40f49056 [FIX] service: correct exception handlers not to catch BaseException
bzr revid: odo@openerp.com-20100624134332-t0n902c7l2qnpcxn
2010-06-24 15:43:32 +02:00
Olivier Dony 6747bdc080 [FIX] http[s]-server: made startup message different for HTTPS
bzr revid: odo@openerp.com-20100616154904-99erlidceq3menel
2010-06-16 17:49:04 +02:00
Olivier Dony 983ace0a07 [FIX] netrpc: corrected exception handling + cleanup of main receive loop
bzr revid: odo@openerp.com-20100616101557-ecaw1j1f5lvncecl
2010-06-16 12:15:57 +02:00
Antony Lesuisse 1b65390179 cleanup exception without traceback
bzr revid: al@openerp.com-20100607161636-6bezdwe8e0d187xi
2010-06-07 18:16:36 +02:00
Stephane Wirtel ac1cc7ebf5 [IMP] Add the xmlrpcs option group for the xmlrpc secure mode
[FIX] Availability to disable the Http, Https and NetRPC server via the command line

bzr revid: stephane@openerp.com-20100531141739-5z419xwhmaqikdba
2010-05-31 16:17:39 +02:00
Christophe Simonis e5588c57d3 [FIX] rename database: set the cursor in autocommit mode
bzr revid: chs@openerp.com-20100527141347-rusf72102qic1pvb
2010-05-27 16:13:47 +02:00
Anup (OpenERP) 67277f6f3d [MERGE] Merged from the main trunk server branch.
bzr revid: ach@tinyerp.com-20100520050727-zdkp6mp65kmfm66o
2010-05-20 10:37:27 +05:30
Christophe Simonis 63355adfc3 [FIX] correct socket closing
lp bug: https://launchpad.net/bugs/574874 fixed

bzr revid: chs@openerp.com-20100518154123-omus9gdr04zts4j0
2010-05-18 17:41:23 +02:00
Jay (Open ERP) 47c1d21759 [FIX] Document : It should be allowed to browse through FTP,disregard to --no-databse-list option
bzr revid: jvo@tinyerp.com-20100512130756-2mtjv7k4kfpdckkg
2010-05-12 18:37:56 +05:30
Harry (Open ERP) 84a0a39d23 [FIX] service: resolved error if words has only body like do_put method send only body if forcely submit data
bzr revid: hmo@tinyerp.com-20100422134354-a189wues9k74dsa1
2010-04-22 19:13:54 +05:30
Chris Halls e5ee85c745 [FIX] renamed function name db_exist -> exp_db_exist
Fixes problem when trying to restore a database.

See p_christ@hol.gr-20090829152346-7i1iiqs8skdddamq for the function rename

bzr revid: chris.halls@credativ.co.uk-20100409113823-4xuc1bm8zdyfiq32
2010-04-09 12:38:23 +01:00
Harry (Open ERP) 8326caf5de [IMP] service: pass db parameter in checkRequest for http
bzr revid: hmo@tinyerp.com-20100406110953-5x0h9b3jlytnkty6
2010-04-06 16:39:53 +05:30