diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2015-07-22 21:23:49 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2015-07-22 21:23:49 (GMT) |
commit | 21537636cd8318cf5a720211619ad3c3023b52e9 (patch) | |
tree | 93380a9152f18e39cf0ba427ede96533c5c6f16a /src/arch | |
parent | 361a0953c73635c6c383516280a8d634768f8226 (diff) |
Fortified the client/server protocol and first exchanges.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@554 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/arch')
-rw-r--r-- | src/arch/vmpa.c | 11 | ||||
-rw-r--r-- | src/arch/vmpa.h | 4 |
2 files changed, 7 insertions, 8 deletions
diff --git a/src/arch/vmpa.c b/src/arch/vmpa.c index d966341..9f2245c 100644 --- a/src/arch/vmpa.c +++ b/src/arch/vmpa.c @@ -320,12 +320,12 @@ bool recv_vmpa(vmpa2t *addr, int fd, int flags) virt_t val64; /* Valeur sur 64 bits */ bool status; /* Bilan d'une réception */ - status = safe_recv(fd, &val64, sizeof(virt_t), flags); + status = safe_recv(fd, &val64, sizeof(uint64_t), MSG_WAITALL | flags); if (!status) return false; addr->physical = be64toh(val64); - status = safe_recv(fd, &val64, sizeof(virt_t), flags); + status = safe_recv(fd, &val64, sizeof(uint64_t), MSG_WAITALL | flags); if (!status) return false; addr->virtual = be64toh(val64); @@ -353,10 +353,10 @@ bool send_vmpa(const vmpa2t *addr, int fd, int flags) { bool status; /* Bilan d'une émission */ - status = safe_send(fd, (virt_t []) { htobe64(addr->physical) }, sizeof(virt_t), flags); + status = safe_send(fd, (uint64_t []) { htobe64(addr->physical) }, sizeof(uint64_t), MSG_MORE | flags); if (!status) return false; - status = safe_send(fd, (virt_t []) { htobe64(addr->virtual) }, sizeof(virt_t), flags); + status = safe_send(fd, (uint64_t []) { htobe64(addr->virtual) }, sizeof(uint64_t), flags); if (!status) return false; return true; @@ -612,7 +612,6 @@ bool load_vmpa(vmpa2t *addr, const bound_value *values, size_t count) /****************************************************************************** * * * Paramètres : addr = adresse virtuelle ou physique à traiter. * -* create = indique si la préparation vise une création ou non. * * values = couples de champs et de valeurs à lier. [OUT] * * count = nombre de ces couples. [OUT] * * * @@ -624,7 +623,7 @@ bool load_vmpa(vmpa2t *addr, const bound_value *values, size_t count) * * ******************************************************************************/ -bool prepare_vmpa_db_statement(const vmpa2t *addr, bool create, bound_value **values, size_t *count) +bool prepare_vmpa_db_statement(const vmpa2t *addr, bound_value **values, size_t *count) { bound_value *value; /* Valeur à éditer / définir */ diff --git a/src/arch/vmpa.h b/src/arch/vmpa.h index 368b765..8881ac1 100644 --- a/src/arch/vmpa.h +++ b/src/arch/vmpa.h @@ -138,7 +138,7 @@ vmpa2t *string_to_vmpa_virt(const char *); /* Définition du tronc commun pour les créations SQLite */ #define SQLITE_VMPA_CREATE \ "phys INTEGER, " \ - "virt INTEGER, " + "virt INTEGER" /* Décrit les colonnes utiles à un chargement de données. */ bool setup_load_for_vmpa(const vmpa2t *, bound_value **, size_t *); @@ -147,7 +147,7 @@ bool setup_load_for_vmpa(const vmpa2t *, bound_value **, size_t *); bool load_vmpa(vmpa2t *, const bound_value *, size_t); /* Constitue les champs destinés à une insertion / modification. */ -bool prepare_vmpa_db_statement(const vmpa2t *, bool, bound_value **, size_t *); +bool prepare_vmpa_db_statement(const vmpa2t *, bound_value **, size_t *); |