Commit Graph

12711 Commits

Author SHA1 Message Date
Marc-André Lureau
b9d7b80897 win32: make gio stream cancellable
v2:
 - fix cancellation of concurrent readers
 - replace g_assert() usage with g_warn_if_fail()
v3:
 - fix indentation
 - fix loop code to not leak (silly me)

https://bugzilla.gnome.org/show_bug.cgi?id=679288
2012-08-20 17:10:31 +02:00
Marc-André Lureau
4b5d762d5d win32: handle ERROR_MORE_DATA
If a named pipe is being read in message mode and the next message is
longer than the nNumberOfBytesToRead parameter specifies, ReadFile
returns FALSE and GetLastError returns ERROR_MORE_DATA.

Since the API doesn't allow to return both a GError and the number of
bytes read so far, it makes more sense to return nread, and let the
client call GetLastError() himself to check if ERROR_MORE_DATA.

The current alternative loses the nread information.

https://bugzilla.gnome.org/show_bug.cgi?id=679288
2012-08-20 17:10:31 +02:00
Marc-André Lureau
23d80a04da win32: use overlapped events for streams
Any file handle created with FLAG_OVERLAPPED must have
ReadFile()/WriteFile() called with an OVERLAPPED structure.
Failing to do so will give unspecified results, invalid read/write or
corruption.

Without FLAG_OVERLAPPED, it is not possible to read and write
concurrently, even with two seperate threads, created by 2 input and
output gio streams. Also, only with FLAG_OVERLAPPED may an IO
operation be asynchronous and thus be cancellable.

We may want to call ReOpenFile() to make sure the FLAG is set, but
this API is only available since Vista+.

According to MSDN doc, adding the OVERLAPPED argument for IO operation
on handles without FLAG_OVERLAPPED is allowed, and indeed the existing
test still passes.

v2:
- update GetLastError() after _g_win32_overlap_wait_result ()
- split the unrelated ERROR_MORE_DATA handling

https://bugzilla.gnome.org/show_bug.cgi?id=679288
2012-08-20 17:10:31 +02:00
Thomas Hindoe Paaboel Andersen
96a0c589ee gmem.c: array is only paritally filled by memcpy
The size of the local_data arrray is too large. It should not be
multiplied by the sizeof guint.

The memcpy of profile_data to local_data later will only fill a part of the
array.

Spotted with the PVS-Studio static analyzer

https://bugzilla.gnome.org/show_bug.cgi?id=681501
2012-08-20 16:41:42 +02:00
Daniel Mustieles
248cc2c885 Updated Spanish translation 2012-08-20 14:15:39 +02:00
Matthias Clasen
cbf346ce53 Remove some more 'the the' 2012-08-19 02:27:04 -04:00
Matthias Clasen
efd822bb07 Improve test coverage for GSocketConnection 2012-08-19 02:26:42 -04:00
Matthias Clasen
cc5d7ccdba Improve test coverage for unix socket addresses 2012-08-19 02:26:05 -04:00
Matthias Clasen
63eaeb223b Improve test coverage for resources 2012-08-19 02:25:37 -04:00
Matthias Clasen
beea8c5c84 Improve test coverage for filter streams 2012-08-19 02:25:21 -04:00
Matthias Clasen
b22f4a2dd2 Improve test coverage for unix streams 2012-08-19 02:25:02 -04:00
Matthias Clasen
3afec2b872 Improve test coverage for pollable streams 2012-08-19 02:24:44 -04:00
Matthias Clasen
eeb4951c47 Improve GSettings test coverage 2012-08-19 02:24:04 -04:00
Matthias Clasen
f89e9deaec Improve GAppInfo test coverage 2012-08-19 02:23:32 -04:00
Matthias Clasen
35bf77445b Add some GInetAddress tests 2012-08-19 02:22:59 -04:00
Matthias Clasen
867ad1cebc Add some GPermission tests 2012-08-19 02:22:33 -04:00
Matthias Clasen
2687d921e1 Cosmetic change
gtk-doc doesn't need <!-- --> anymore to recognize plural
forms of links.
2012-08-19 02:21:02 -04:00
Matthias Clasen
4dbcd27eee Make GPermission more forgiving
It is not great if calling g_permission_acquire on a simple
permission object just segfaults. This commit arranges for
this to return a G_IO_ERROR_NOT_SUPPORTED error.
2012-08-19 02:19:27 -04:00
Matthias Clasen
4a8740d0d2 It is 'registered', not 'registred' 2012-08-18 23:17:47 -04:00
Matthias Clasen
e27367f341 Exterminate 'the the' 2012-08-18 23:15:58 -04:00
Matthias Clasen
96ed9e41f4 Improve utils test coverage 2012-08-18 14:42:10 -04:00
Matthias Clasen
cb8f88ca9f Improve uri test coverage 2012-08-18 14:41:48 -04:00
Matthias Clasen
2c338e21d6 Improve strfuncs tests coverage 2012-08-18 14:41:35 -04:00
Matthias Clasen
58c7747c50 Improve GRegex test coverage 2012-08-18 14:41:23 -04:00
Matthias Clasen
a7e10fa0b6 Improve GPrivate test coverage 2012-08-18 14:41:07 -04:00
Matthias Clasen
aad40b89fe Improve file utils test coverage 2012-08-18 14:40:33 -04:00
Matthias Clasen
6e1d205ad3 Improve GError test coverage 2012-08-18 14:40:15 -04:00
Matthias Clasen
e181234fe5 Improve atomic ops test coverage 2012-08-18 14:39:52 -04:00
Matthias Clasen
06d837b6a3 Improve array test coverage 2012-08-18 14:39:28 -04:00
Matthias Clasen
373dcaea56 Improve threadpool test coverage 2012-08-18 14:38:53 -04:00
Fran Diéguez
a946892b1e Updated Galician translations 2012-08-17 23:17:51 +02:00
Owen W. Taylor
2360d04e50 Fix problems with CLEANFILES and automake-1.11.1
Running with automake-1.11.1, a couple fixes are needed
for CLEANFILES when gtk-doc is not installed.

(Found with Amazon Linux AMI release 2012.03)

https://bugzilla.gnome.org/show_bug.cgi?id=682067
2012-08-17 13:41:34 -04:00
Krishnababu Krothapalli
fdcdcf4f2f Updated Telugu Translations 2012-08-17 19:43:40 +05:30
Krishnababu Krothapalli
a53ccea814 Updated Telugu Translations 2012-08-17 19:22:00 +05:30
Chun-wei Fan
2954f70d39 Fix build on Visual C++
-glib/gmarkup.c: Use G_VA_COPY() instead of va_copy() as va_copy() may not
 be universally available.
-gio/gtestdbus.c: Include io.h on Windows for close()
2012-08-17 19:22:43 +08:00
Мирослав Николић
69124b2dc4 Updated Serbian translation 2012-08-17 12:59:44 +02:00
Nilamdyuti Goswami
f116437c7e Assamese translation updated 2012-08-17 14:23:19 +05:30
Sandeep Sheshrao Shedmake
56e9f896c6 Updated Marathi Translations 2012-08-17 12:24:15 +05:30
David King
86a4fd6fa9 docs: Describe GCompletion item memory management
https://bugzilla.gnome.org/show_bug.cgi?id=600751
2012-08-17 07:16:50 +01:00
Matthias Clasen
b13a79aeb4 Adapt schema tests to changed error messages 2012-08-17 01:15:08 -04:00
Colin Walters
056d39c9f7 GMappedFile: Add g_mapped_file_get_bytes()
This is yet another API that has a data/length/refcount combination
that one might often want to turn into a GBytes.

https://bugzilla.gnome.org/show_bug.cgi?id=677065
2012-08-17 00:48:40 -04:00
Matthias Clasen
b0d8498ee3 GDateTime: pack the struct better
Makes a difference in 32bit.
2012-08-17 00:27:10 -04:00
Matthias Clasen
86329ba44f gdbus: Use g_markup_collect_known_attributes() in GDBus introspection
In order to be able to cope with the introspection XML
from the Telepathy specification, which uses attributes
like tp:type and tp:name-for-bindings, we need to ignore
unknown attributes when parsing.
Closes: https://bugzilla.gnome.org/show_bug.cgi?id=665634
2012-08-16 23:41:19 -04:00
Matthias Clasen
8d40389d15 gmarkup: Add g_markup_collect_known_attributes()
Add a variant of g_markup_collect_attributes() which will
ignore unknown attributes (such as those from different XML
namespaces) when parsing markup, rather than returning
G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE as g_markup_collect_attributes()
does.

Patch by Philip Withnall,
https://bugzilla.gnome.org/show_bug.cgi?id=665634
2012-08-16 23:40:08 -04:00
Matthias Clasen
21aff13d22 Fix 'make report'
Turns out this doesn't work unless every Makefile.am includes
Makefile.decl.
2012-08-16 23:23:16 -04:00
Matthias Clasen
6bee6dbce5 Miscellaneous string fixes
Typo and punctuation fixes, and some rewording, based
on a patch by Philip Withnall, bug
https://bugzilla.gnome.org/review?bug=628193
2012-08-16 23:02:41 -04:00
Matthias Clasen
e4dc223e9d Make capitalisation of "UNIX" consistent in translatable strings
Based on a patch by Philip Withnall, bug
https://bugzilla.gnome.org/review?bug=628193
2012-08-16 22:47:43 -04:00
Matthias Clasen
191f09b044 Change "dash" to "hyphen" in translatable strings
GSchemas use hyphens, not dashes.
Patch by Philip Withnall, bug
https://bugzilla.gnome.org/review?bug=628193
2012-08-16 22:23:20 -04:00
Matthias Clasen
4e55bebb7a Fix leak in GWinHttpVfs
Patch by Ole André Vadla Ravnås, bug
https://bugzilla.gnome.org/show_bug.cgi?id=627423
2012-08-16 22:17:46 -04:00
Matthias Clasen
6ef1e56479 Fix leak in GFileAttributeInfoList
Patch by Ole André Vadla Ravnås, bug
https://bugzilla.gnome.org/show_bug.cgi?id=627423
2012-08-16 22:15:54 -04:00