Commit Graph
42 Commits
Author SHA1 Message Date
Andrew Lindesay 8f30879b98 Support : Validation for Host Portion of URL
Partly Fixes #14377

Change-Id: Ia611d3653d2c16c6dcdc48ce57bd61bb6e6db366
Reviewed-on: https://review.haiku-os.org/476
Reviewed-by: Adrien Destugues <[email protected]>
2018-08-25 18:50:36 +00:00
Andrew Lindesay b3a7d91b2e HaikuDepot : Fix for List Algorithm
Fix a mistake in the binary search and insert
algorithms that was causing stability issues.

Fixes #14284
2018-07-18 23:05:58 +02:00
Andrew Lindesay 3b17d8dd7f HaikuDepot / PackageKit: Repositories 'Identifier' URL
Repositories are identified with a 'url' in the
remote 'repo.info' file.  There is also a
'base url' which is the URL locally with which
the system is able to access the repository
data on.  There is some confusion between these
two terms in the source.  This change aims to
separate the two out and consistently name them.
The settings for the repository locally also was
not storing these values and that has been fixed.
Debug info about the repositories also did not
display the two urls consistently and will now
also do so.  Finally, HaikuDepot now correlates
locally configured repositories with the data in
HaikuDepotServer using the identifier URL; this
makes the use of mirrors with HaikuDepot possible.

Fixes #13888
Change-Id: I66dfe589b05c24e1ab123a6945352e0f24b60bf1
2018-07-05 20:06:54 +00:00
Andrew Lindesay cd417b96c9 HaikuDepot: Trace Logging of RPC Payloads
Changes the trace logging so that JSON-RPC payloads
are included in the log stream.  Also fixes a
memory-leak in the JSON-RPC client.

Change-Id: Ic19c64869acc525232a60ac2fd814a71bfdafdc8
2018-07-04 13:27:42 +00:00
Andrew Lindesay a9edb9bffa HaikuDepot: Multiple improvements for user-ratings
* Display of the user-ratings listing improved
* When a user-rating is created / edited, the pkg is updated
* Creation date of the user-rating is unpacked shown
* Ability to create a user-rating with a comment, but no numerical rating
* Stars display show grey if no numerical rating present
* Improvements to error reporting when problem arise
* Parsing of the 'revision' field of the version working
* Removed debug logging for the text engine
* Other minor tweaks

Change-Id: I99f881ab1426641ef4177eec2d3bcacc7cb74e95
2018-06-09 17:07:03 +00:00
Andrew Lindesay b45e8b1ef9 HaikuDepot : additional debugging for json-rpc invocations 2018-03-25 05:44:19 +00:00
Andrew Lindesay d13c3d8967 HaikuDepot : Handling for Depot Name Anomalies
There is a problem primarily manifesting itself in
the x86_64 build where the packages' names from the
solver are not correlating with the names of the
as-configured depots.  There was also a problem
with a local variable being the same name as a function
parameter.  This does not fix the underlying problem,
but avoids further anomalies in the HaikuDepot UI.

Possibly related trac #11317, #11674, #13940.
Change-Id: Ic140f114bbe38e59c78760213843bf492ff7a270
2018-03-22 10:14:34 +00:00
Andrew Lindesay d5b1013185 HaikuDepot : Coalesce Loading Change Notifications
When the application is starting, it will load in bulk data.  As it
does so, it may issue some change notifications to listeners.  For
each small change in packages' data, there is a notification.  The
system was built to accommodate coalesced changes.  This commit will
coalesce those changes during the bulk load for cases where there
are listeners present.

Change-Id: I1cc6668f61917c0068d5559b2bf338ea75d453da
2018-03-03 20:01:16 +00:00
Andrew Lindesay 54312619ab HaikuDepot : 'Old Client' Handling
The server side has the ability to reject client
requests where the client is no longer supported
because it is presumably too old.  This change
will inform the user when this happens and will
prevent the client from attempting further server
communications within this execution of the
application.
2018-02-26 21:51:45 +00:00
Andrew Lindesay 80a272eed8 HaikuDepot : Changelog, Remove old API and Version Bump
This change re-instates the change-log function (TRAC#13827) that was
dropped in earlier changes.  Also now-disused API handling logic is
removed.  A small code-style fix is made and the version of the
application has been incremented so that this version's logic can later
be detected by the HDS application server.
2018-01-28 12:43:26 +01:00
Andrew Lindesay d483b4d0b5 HaikuDepot : More Backend Communications Improvements
Fixes for x86_64 build (tests)
2017-12-20 00:14:37 +01:00
Andrew Lindesay 1065ea343d HaikuDepot : More Backend Communications Improvements
Fixes for x86_64 build (additional)
2017-12-19 23:26:21 +01:00
Andrew Lindesay 29f98e1f33 HaikuDepot : More Backend Communications Improvements
Fixes for x86_64 build.
2017-12-19 22:47:04 +01:00
Andrew Lindesay 0df6decf1b HaikuDepot : More Backend Communications Improvements
Added missing files from prior commit.
2017-12-19 21:50:31 +01:00
Andrew Lindesay 3094fef308 HaikuDepot : More Backend Communications Improvements
* Further improves the logging and provides some
  basic performance numbers.
* Moves the bulk-load logic out of the data-model
  class.
* Introduces a state-machine for the bulk-load
  process so that it will be more easily able to be
  shifted to non-blocking IO when the HTTP libraries
  can do that.
* Implements concurrent loading of the bulk-data to
  hopefully improve lead time for icons and meta-data.
* Loads data to a temporary file and then moves to the
  final location in order to avoid partially written
  data in the cache.
* Handles situations where no network is available;
  prevents attempt to access the network.
* Allows bulk-load processes to be cancelled when the
  application quits.
* Introduces command-line arguments to help simulate
  scenarios to help with testing performance and
  network absence.
* Implements ordered insert and binary search in the
  'List' class + basic unit test.
2017-12-19 20:56:53 +01:00
Andrew Lindesay f69a80b4bb HaikuDepot: Handling Corrupted Download Data
Damage in latter portions of the downloaded package data can cause the
meta-data for the caching to load OK, but the actual data is unable to
be parsed.  In this case, the application can fail to refresh the
broken data.  This change will mean that the data is "moved aside" into
another file so that on the next run, the application will load fresh
data in place.
2017-11-15 22:32:06 +01:00
Andrew Lindesay c23b641cf1 HaikuDepot: New Mechanic for Package Data Download
The application was previously making a number of different
requests to the application server in order to pull-down
meta-data (ratings, localization etc...) for packages.  This
will now happen in one request per repo.  The data is
also cached locally and freshness of the data is checked
back with the server before new data is pulled down.
2017-11-11 23:49:26 +01:00
Andrew Lindesay f0665db479 HaikuDepot: Improved logging control
The application had previously no means to control the verbosity of
logging.  This excessive logging meant that it was bit hard to
understand what is going on.  Now it is possible to define the level
of logging that is output; especially as the application pulls-down
data from the remote server system.
2017-11-05 15:26:35 +01:00
Andrew Lindesay 3d528c4a60 HaikuDepot: Change communication mechanism with server for repos
(last commit with same title only included new files - added those now)

Previously the desktop application would make a number of JSON-RPC calls
over HTTP to get the repositories.  Now it will make a single call to get
the repositories and cache the result.  This uses standard HTTP cache
signalling techniques and allows the server-side the ability to cache
the generated data as well.  Note that the model classes and parse-
related classes are generated and may not be code-style compliant.  They
are generated from JSON schema files in the server-side project.
Information about this as well as the python files used to generate the
C++ classes and headers are included in the server-side project.
2017-11-03 20:10:01 +01:00
Andrew Lindesay e457080a4a HaikuDepot: Change communication mechanism with server for repos
Previously the desktop application would make a number of JSON-RPC calls
over HTTP to get the repositories.  Now it will make a single call to get
the repositories and cache the result.  This uses standard HTTP cache
signalling techniques and allows the server-side the ability to cache
the generated data as well.  Note that the model classes and parse-
related classes are generated and may not be code-style compliant.  They
are generated from JSON schema files in the server-side project.
Information about this as well as the python files used to generate the
C++ classes and headers are included in the server-side project.
2017-10-20 22:33:10 +02:00
Andrew Lindesay a1c3daa638 HaikuDepot : Streaming Icon Meta-Data Parser
More background work for later performance improvements.
This change generalizes the parsing of meta-data from
JSON streams as similarly structured meta-data is
anticipated to be carried in other payloads.  Unit tests
have also been implemented to provide coverage on this
new functionality.
2017-08-01 23:19:27 +02:00
Andrew Lindesay f943fa465c JSON Parser : Documentation migration
This commit migrates the JSON overview documentation that
was recently added from Markdown to Doxygen.
2017-05-26 21:05:14 +12:00
Andrew Lindesay 55f5f25940 JSON Parser : code style corrections 2017-05-16 00:21:15 +12:00
Andrew Lindesay 0c28e8e5a0 Implementation of JSON Streaming Parser
Fix warnings related to x86_64 tests' compilation.
2017-05-14 10:44:03 +12:00
Andrew Lindesay e6fa1be5fd Implementation of JSON Streaming Parser
Addition of missing files from previous commit
2017-05-13 19:35:51 +12:00
Andrew Lindesay 1f6b57a5d2 Implementation of JSON Streaming Parser
This change will introduce a streaming parser capability to Haiku.  The
existing functionality of writing the JSON data to a BMessage in-memory
model is retained.  The new parser implements a SAX-style listener based
interface where the listener accepts parse events.  Unit tests have been
supplied for the JSON parser as well.
2017-05-13 18:50:39 +12:00
Andrew Lindesay 7407e36a10 HaikuDepot; date formatting and location header handling
The existing HTTP header date format handling code is employed
rather than using specific logic for HD.  Also the "Location"
header handling is changed to work better for non-absolute
URLs arriving in this header value on a redirect.  Both
suggestions from Adrien.
2017-01-31 23:06:20 +13:00
Andrew Lindesay 1290dd9132 HaikuDepot: changes from code review from Jessica 2017-01-31 21:18:39 +13:00
Andrew Lindesay 0c1bbfe508 HaikuDepot: suggested code improvements from Adrien 2017-01-31 20:45:36 +13:00
Andrew Lindesay 19c15fec85 HaikuDepot: Improve icon download handling performance
Previously each icon would launch an independent HTTP request to
pull down the HVIF icon data.  This change means that the data
will be pulled down in bulk across all packages as a .tgz and
will then be kept in a cache locally.  The client-server logic
will use standard "If-Modified-Since" headers to check for
updates each time the HaikuDepot desktop application starts up.
This arrangement will bring down the HVIF as well as bitmap
icons and use the best representation it can.

Additionally, it is possible from a command-line option to log
HTTP traffic verbosely and it is also possible to use an "-h"
flag to display help on command-line arguments.

The code-structure around this change also anticipates some
future extensions to handle other client-server improvements.

Fixes #11804
2017-01-27 21:14:13 +13:00
Andrew Lindesay b6c8f81bf8 build: add support for build paths for 'homebrew' package system on macOS 2017-01-22 20:50:02 +13:00
Andrew Lindesay cf65729463 Url: implement same URL parsing logic in C/C++ code
- Remove uses of group matching regular expression, not available on all
  build hosts,
- Parsing is faster than our old regexp engine.

Signed-off-by: Adrien Destugues <[email protected]>

- Fixes #13002
- Fixed some indentation (tabs vs space), please configure your editor
  properly.
2016-10-31 09:14:44 +01:00
Andrew Lindesay 000b15f2c3 HaikuDepot: Adjust URLs for use with HDS
HDS paths are now prefixed with "__".  This change
makes the corresponding change to the HaikuDepot
desktop application

Fixes #13030.
2016-10-26 23:39:34 +13:00
Andrew Lindesay be29847471 HaikuDepot: code clean-up from #12793 2016-10-21 21:52:13 +13:00
Andrew Lindesay ebb1a01c48 HaikuDepot: Handling for communications with application server over multiple repositories
This change allows for the HaikuDepot desktop application to query the server application
over HTTP for data regarding packages across the various repositories that the have been
configured on the desktop environment.  Previously it was 'hard-coded' to only
communicate about the HaikuPorts repository.
2016-10-20 23:03:10 +13:00
Andrew Lindesay fa2dd9c45f BPackageInfo::Parser: Validate URL strings.
Fixes #12710.

Signed-off-by: Augustin Cavalier <[email protected]>
I fixed the modifications to the Jamfiles in src/bin, they were all wrong
in the patch.
2016-06-18 18:40:07 -04:00
Andrew Lindesay b8d10c6dc6 HaikuDepot: Enhancements to the User-Agent header to include the version.
Signed-off-by: Augustin Cavalier <[email protected]>
Fixes #12262.
2015-08-07 21:17:14 -04:00
Andrew Lindesay 3860139319 hvif2png: Fix build on Mac OS X.
* Add support for macports lib and headers dirs.
 * Link libs change for Mac OS X for tool build.

Signed-off-by: Augustin Cavalier <[email protected]>
2015-07-25 10:23:24 -04:00
Andrew Lindesay 93407f0c87 HaikuDepot: desktop app can now have server url specified
* Enables us to test to other HD servers

Completes Task #12216
2015-07-19 08:46:26 -05:00
Andrew Lindesay 874bb4ede9 hvif2png: Input file reading fix, file magic check
* Fix an infinite loop on reading a larger file.
* Check hvif magic number

Ticket #12207.

Signed-off-by: Ingo Weinhold <[email protected]>
2015-07-19 11:42:18 +02:00
Andrew Lindesay f712bf3e60 Add build tool to render hvif icon files as png
Signed-off-by: Ingo Weinhold <[email protected]>
2015-07-18 08:06:47 +02:00
Andrew Lindesay b4c773d32e modified layout intro docsZ
Signed-off-by: John Scipione <[email protected]>
2014-06-02 20:13:16 -04:00